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

query without '=' is form too #44

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

yakunink
Copy link

Hello,

This pull request fixes issue #34.

Happy hacktoberfest!

@oalders
Copy link
Member

oalders commented Oct 10, 2017

Thanks for this! I see that you did add an additional test. Would you be able to add a test specifically for https://example.com/?foo and add a comment? The tests cases as they currently stand are light on documentation. :)

@oalders
Copy link
Member

oalders commented Oct 11, 2017

Thanks @yakunink. LGTM.

@oalders oalders requested a review from skaji October 11, 2017 14:41
@skaji
Copy link
Member

skaji commented Oct 11, 2017

Before this PR, query_form() and query_keywords() are mutually exclusive;
i.e, if query_form() returns a non-empty list, then query_keywords() returns an empty list, and vice versa.

I think Web::Request expect this behavior.
https://grep.metacpan.org/search?size=20&q=query_keywords
https://metacpan.org/source/DOY/Web-Request-0.11/lib/Web/Request.pm#L225-228

That is, this PR may break some existing perl code which uses URI module.
Sorry, this was an overstatement.

I'm just not sure what query_form() should return for http://example.com/?foo+bar.

@yakunink
Copy link
Author

From this html-book chapter Creating Searchable Documents and this article The History of the URL seems that keywords used to send search queries. I think separating search query phrase into words inside URI object is not good idea.
So I would prefer to get { 'foo bar' => '' } from query_form() as it works now.

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

Successfully merging this pull request may close these issues.

3 participants