Skip to content
This repository has been archived by the owner on Oct 15, 2022. It is now read-only.

ensure top level req before processing query #23

Merged
merged 1 commit into from
Oct 7, 2013

Conversation

majuscule
Copy link
Collaborator

DuckPAN is forwarding the query parameter to multiple calls for some reason (is this intended behavior?):

127.0.0.1 - - [07/Oct/2013:03:48:54 -0400] "GET /?duckduckhack_ignore=1&q=perl%20jobs%20in%20san%20francisco&l=us-en&p=1&s=0 HTTP/1.1" 200 0 "http://0.0.0.0:5000/" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/29.0.1547.76 Safari/537.36"
127.0.0.1 - - [07/Oct/2013:03:48:55 -0400] "GET /y.js?s=1&q=perl%20jobs%20in%20san%20francisco&l=us-en HTTP/1.1" 200 0 "http://0.0.0.0:5000/" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/29.0.1547.76 Safari/537.36"
127.0.0.1 - - [07/Oct/2013:03:48:56 -0400] "GET /y.js?x=1&q=perl%20jobs%20in%20san%20francisco&l=us-en&safe=1 HTTP/1.1" 200 0 "http://0.0.0.0:5000/" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/29.0.1547.76 Safari/537.36"
127.0.0.1 - - [07/Oct/2013:03:48:56 -0400] "GET /?duckduckhack_ignore=1&q=perl%20jobs%20in%20san%20francisco HTTP/1.1" 200 0 "http://0.0.0.0:5000/" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/29.0.1547.76 Safari/537.36"

Whatever the reason for that, Web.pm is not properly checking that a query is placed against the proper resource /. This additional check avoids the duplicated processing, and with it, prevents the confusingly repeated Data::Printer output.

Resolves issue #17.

@ghost ghost assigned moollaza Oct 7, 2013
@yegg
Copy link
Member

yegg commented Oct 7, 2013

It really shouldn't be writing y.js at all to this as well -- should open a PR internally to prevent that for these special duckduckhack queries.

@yegg
Copy link
Member

yegg commented Oct 7, 2013

Made the internal PR.

@moollaza
Copy link
Member

moollaza commented Oct 7, 2013

LGTM 👍

moollaza added a commit that referenced this pull request Oct 7, 2013
ensure top level req before processing query
@moollaza moollaza merged commit 8aee863 into master Oct 7, 2013
@moollaza moollaza deleted the dylan/duplicate-req-process-fix branch October 7, 2013 19:34
@yegg
Copy link
Member

yegg commented Oct 8, 2013

released

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

Successfully merging this pull request may close these issues.

3 participants