BrickTwo / BrickHunter

26 stars 8 forks source link

CORS issue with Bricklink #208

Closed mrplow87 closed 8 months ago

mrplow87 commented 8 months ago

Today I started getting a "Something went wrong" error when adding a new partlist, regardless of copy-pasting XML from Bricklink or uploading a file.

Digging into it, I came across these errors:

Access to XMLHttpRequest at 'https://api.bricktwo.net/v2/bricklink/parts' from origin 'chrome-extension://plhoblcmafoglbnhekjmegkknhifedne' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource.

POST https://api.bricktwo.net/v2/bricklink/parts net::ERR_FAILED 500 (Internal Server Error)

The request before, to https://api.bricktwo.net/v2.1/rebrickable/parts, works fine.

Browsers tested: Chrome 122.0.6261.95, Firefox 115.7.0esr, MS Edge 122.0.2365.59

BrickTwo commented 8 months ago

Thanks for mentioning it.

There went actually something wrong with the sync to the Rebrickable data and therefore when BrickHunter requested this data it returned an empty array which led to the error in the second api request.

Should work now again.