Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Parsing get parameters. Looks like small bug. #500

Closed
korjavin opened this issue Jun 5, 2013 · 5 comments
Closed

Parsing get parameters. Looks like small bug. #500

korjavin opened this issue Jun 5, 2013 · 5 comments

Comments

@korjavin
Copy link

korjavin commented Jun 5, 2013

I create simple mojo app

sub welcome {
my $self = shift;
my $ka = $self->param('ka') // 'Missed ka';

Render template "example/welcome.html.ep" with message

$self->render(
message => $ka);
}
Full code here: https://github.com/korjavin/mojo-param-test

Its just write to browser back one get parameter named 'ka'.

I start it with morbo , and do request with my google chrome browser ( 29.0.1521.3 dev )

When I do request:
http://127.0.0.1:3000/?str=79AD8A6C36932F6E84886C1%3E33D7DBE9E&ka=007
It works well and write me 007
When I do request
http://127.0.0.1:3000/?str=79AD8A6C36932F6E84886C1%3E|33D7DBE9E&ka=007
added this '|' symbol

It can't parse 'ka' parameter and return 'missed ka' to my browser.

Not sure, is it bug or not, but its strange at least for me .

@jberger
Copy link
Member

jberger commented Jun 5, 2013

ding ding ding 500 issues! hooray!

@jberger
Copy link
Member

jberger commented Jun 5, 2013

when the | is properly url encoded to %7C everything works fine.

@jberger
Copy link
Member

jberger commented Jun 5, 2013

running

perl -Mojo -E 'a(sub { $_[0]->render(text => r $_[0]->req->url->query->params) })->start' get '/?str=sihg|hgohg&ka=hi'

works

perl -Mojo -E 'a(sub { $_[0]->render(text => r $_[0]->req->url->query->params) })->start' daemon

and requesting in the browser does not (when the query contains a |). Therefore I don't believe this is a mojolicious bug, but your browser not encoding your query string (which you can do manually)

@jberger jberger closed this as completed Jun 5, 2013
@korjavin
Copy link
Author

korjavin commented Jun 6, 2013

Yes, but same in firefox19.0.2, same in links.

I understood that its not mojo bug, but may be mojo able to fix that.

Dont know. You guys are more competent.

@kraih kraih reopened this Jun 6, 2013
@kraih kraih closed this as completed in 6ba7319 Jun 6, 2013
@korjavin
Copy link
Author

korjavin commented Jun 6, 2013

NIce!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants