arkhn / jpaltime

Apache License 2.0
0 stars 0 forks source link

[Staging] CORS error #34

Closed BPierrick closed 2 years ago

BPierrick commented 3 years ago

Description

CORS error when trying to request https://staging.arkhn.com/hapi/fhir/Patients :

Access to fetch at 'https://staging.arkhn.com/hapi/fhir/Patient?name=p' from origin 'http://localhost:3000' has been blocked by CORS policy: Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin' header is present on the requested resource. If an opaque response serves your needs, set the request's mode to 'no-cors' to fetch the resource with CORS disabled.

Reproduction

  1. Try accessing https://staging.arkhn.com/hapi/fhir/Patient?name=p from a front-end app with headers Authorization: "Basic token"

  2. See error.

Expectation

Request response with header : Access-Control-Allow-Origin: http://localhost:3000

tevariou commented 3 years ago

can you set mode: 'no-cors' in your fetch settings (in dev mode)? That's not a bug, it's a security feature

ps: removed token from op's post