Skip to content

The behavior of query_keywords and query_parameters seems orthogonal, but in actuality it is not. #134

@asparkman

Description

@asparkman

Been using Catalyst for quite some time, and have found it to be a really great framework. Unfortunately, I came across something the other day that seemed a little confusing. I feel a code change, or documentation change may be appropriate.

I am using version 5.90092, but I believe the behavior is the same on the latest.

A data dump of the following:
my( $res, $c) = ctx_request(GET '/test_psgi_keys?x&a=1&b=2');

produces:
$c->req->query_parameters = { x => undef, a = 1, b = 2 }
$c->req->query_keywords = undef

A data dump of the following:
my( $res, $c) = ctx_request(GET '/test_psgi_keys?x');

produces:
$c->req->query_parameters = {}
$c->req->query_keywords = "x"

I feel like in the second case that the query_parameter member should instead be:
$c->req->query_parameters = { x => undef }

The query_keywords documentation states:
"Contains the keywords portion of a query string, when no '=' signs are present."

The query_parameters documentation states:
"Returns a reference to a hash containing query string (GET) parameters. Values can be either a scalar or an arrayref containing scalars."

The query_keywords member appears to have been created to support the isindex element, which is going through various states of deprecation. I understand there are a lot of finer points to this discussion, but I felt it pertinent to open this up for discussion.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions