-
Notifications
You must be signed in to change notification settings - Fork 0
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
Trove API invalidly returns two access-control-allow-origin headers #24
Comments
Trove's response to the following request contains a single curl --verbose 'https://api.trove.nla.gov.au/v3/result?category=newspaper&n=0&encoding=json' Trove's response to the following request contains two curl -H 'Origin: http://localhost' --verbose 'https://api.trove.nla.gov.au/v3/result?category=newspaper&n=0&encoding=json' |
Libraries Australia reference: |
I've had no confirmation from NLA, but the bug appears to be fixed: curl -s --verbose 'https://api.trove.nla.gov.au/v3/result?category=newspaper&n=0&encoding=json' 2>&1 \
| grep --ignore-case --fixed-strings "Access-Control-Allow-Origin:" produces |
Still seems to be broken? curl H 'Origin: http://localhost' --verbose 'https://api.trove.nla.gov.au/v3/result?category=newspaper&n=0&encoding=json' 2>&1 | grep --ignore-case --fixed-strings "Access-Control-Allow-Origin:" Produces:
|
You're absolutely right @wragge that this bug persists. My comment from Dec 20 was mistaken because I failed to send an |
If a request is made to the Trove API containing an "Origin" request header, then the response includes two
access-control-allow-origin
headers, both with the value*
. If a request is made without anOrigin
header, then a singleaccess-control-allow-origin
header is returned. However, requests to the API from a JS client in a browser will always have anOrigin
header, and because multiple Access-Control-Allow-Origin headers are not allowed, these requests will fail, making it impossible to call the Trove API from such a client, except by going through a proxy which can remove one of the supernumerary headers.This is a Trove server error.
The text was updated successfully, but these errors were encountered: