internetarchive / internetarchive/openlibrary
CORS errors on Partner API Single-request and Multi-request endpoints
- Dominant language
- Python
- Stars
- 6.7k
- Forks
- 2k
- Avg merge
- 2d 19h
- Merged PRs (30d)
- 138
Description
Calling the `/volumes/brief` endpoints using native Node.js `fetch()` results in CORS errors.
### Evidence / Screenshot (if possible)

### Relevant url?
Single GET - http://openlibrary.org/api/volumes/brief/isbn/0596156715.json
Multi GET - http://openlibrary.org/api/volumes/brief/json/isbn:0596156715
### Steps to Reproduce
The following snippet recreates the issue;
```
const OpenLibTest = async () => {
(await fetch('http://openlibrary.org/api/volumes/brief/isbn/0596156715.json'))
.json()
.then((data) => {
console.log(data);
});
};
OpenLibTest();
```
* Actual:
* CORS error returned from API
* Expected:
* Data to be returned due to using specified JSON endpoints
### Details
- **Logged in (Y/N)?** N/A
- **Browser type/version?** Chrome rendering Vue/Angular apps
- **Operating system?** Windows 11 / macOS Ventura
- **Environment (prod/dev/local)?** prod
### Proposal & Constraints
I believe the endpoints may just need amending to follow the same logic as in https://github.com/internetarchive/openlibrary/issues/329 and https://github.com/internetarchive/openlibrary/issues/220
Contributor guide
Assessment
This issue has not been assessed yet.