Closed denver-HJS closed 2 years ago
Sorry, I missed this before. This is caused by the missing slash on the end of the URL path — the actual URL is https://chroniclingamerica.loc.gov/search/titles/results/ so Django issues a redirect to the canonical location. If you use that URL it'll have Access-Control-Allow-Origin: *
on both OPTIONS
and GET
responses.
Sorry if this is the wrong place to bring this up, but I've run into some issues trying to integrate with your Search API when trying to access this resource:
https://chroniclingamerica.loc.gov/search/titles/results?terms=Tulsa&format=json
I think there may be some interference by a redirect rule in your application that is blocking CORS requests made by my browser application (in this case an Angular client).
I notice in the browser console that when the browser is making its
OPTIONS
preflight request for CORS, it's returning as a301 Redirect
response. If you refer to the sequence diagram I've pulled from MDN per the protocol the browser is expecting a204 No Content
response with theAccess-Control-Allow-Origin
response header included.Additionally this is in the browser console output:
Feel free to let me know if I should ask this somewhere else, or if I can help provide any additional information!
Thanks