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

works from curl but not from browser #13

Open
devel-pa opened this issue Jul 23, 2013 · 1 comment
Open

works from curl but not from browser #13

devel-pa opened this issue Jul 23, 2013 · 1 comment

Comments

@devel-pa
Copy link

Hi,
Cool stuff.
My env: Win7 x64 Ruby 1.9.3 Stubb 0.1.3

curl http://localhost:4040/hello-world

::1 - - [23/Jul/2013 17:21:17] "GET /hello-world HTTP/1.1" 200 6 0.0080 "D:/project/services/hello-world.GET" "YAML Frontmatter: No"
DEV64.AD.LAN.NET - - [23/Jul/2013:17:21:17 Paris, Madrid (heure d??t?)] "GET /hello-world HTTP/1.1" 200 6

from browser

::1 - - [23/Jul/2013 17:21:25] "GET /hello-world HTTP/1.1" 404 - 0.0070 "NONE" "YAML Frontmatter: No"
DEV64.AD.LAN.NET - - [23/Jul/2013:17:21:25 Paris, Madrid (heure d??t?)] "GET /hello-world HTTP/1.1" 404 10

PS:
Works from the Poster Chrome extension

@knuton
Copy link
Owner

knuton commented Jul 26, 2013

The reason it doesn't work from your browser is probably that it sends an accept header something like:

Accept:text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8

Whereas curl (and presumably the Chrome extension) asks for:

Accept: */*

Stubb does not currently possess any proper content negotiation capabilities which would be necessary to accommodate the browser request, attempting to find one of the first three options, before settling for anything (*/*). Stubb simply looks for the first option, so for the browser request it looks for a file ending in .html.

I would be interested in seeing Stubb completed in this respect.

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

2 participants