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

Adding Accept Header so that json is preferred #90

Merged
merged 1 commit into from
Dec 14, 2015

Conversation

alculquicondor
Copy link
Contributor

This is useful when using a different URL other than the official, and the endpoints are able to return not only json, but xml or html for instance. Firefox sets this by default Accept: "text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8" so the plugin fails.

@louh
Copy link
Contributor

louh commented Dec 14, 2015

👍 Thanks for the catch. My Firefox does seem to set the same request header as yours, but accepts JSON anyway, so the plugin works fine... do you know why that is? More relaxed security perhaps?

louh added a commit that referenced this pull request Dec 14, 2015
Adding Accept Header so that json is preferred
@louh louh merged commit 122d45a into pelias:master Dec 14, 2015
@alculquicondor
Copy link
Contributor Author

Yes, it accepts JSON (because of the */* at the end), but the server endpoint prefers to send HTML instead of JSON because of that header.

@alculquicondor alculquicondor deleted the require_json_response branch December 14, 2015 22:41
@louh
Copy link
Contributor

louh commented Dec 14, 2015

Ahh, I see. Out of curiosity, are you using your own instance of Pelias, a fork of it, or a totally different system that has a compatible API?

@alculquicondor
Copy link
Contributor Author

We proxy the official API for our clients

@louh
Copy link
Contributor

louh commented Dec 15, 2015

I see. Thanks!

On Mon, Dec 14, 2015 at 8:59 PM Aldo Culquicondor [email protected]
wrote:

We proxy the official API for our clients


Reply to this email directly or view it on GitHub
#90 (comment)
.

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.

2 participants