PharmaLedger-IMI / epi-workspace

ePI use case main repository
MIT License
4 stars 0 forks source link

Incident: LPWA error in scanning (DEV network) - Query w/ lang=en / Leaflet in lang=de #1107

Closed jaravan1 closed 1 year ago

jaravan1 commented 1 year ago

ePI v1.6.1-patch2 DEV network

Scanning with LPWA ends up with error: image

Because below query fails:

https://epidev.takeda.com/leaflets/dev.epi?leaflet_type=leaflet&lang=en&gtin=05060147024098&expiry=30%20-%20Apr%20-%202024&batch=M0001

image

The leaflet exists in lang=de:

https://epidev.takeda.com/leaflets/dev.epi?leaflet_type=leaflet&lang=de&gtin=05060147024098&expiry=30%20-%20Apr%20-%202024&batch=M0001

but the query from LPWA is only performed in lang=en and since it does not find the leaflet in EN it returns an error.

jaravan1 commented 1 year ago

In order for LPWA to function properly, CORS needs to be enabled for API Hub proxy/nginx/ALB. More specifically, a preflight OPTIONS call is performed from browser when using LPWA and the reply needs to include the following values in HEADER:

{
            "Content-Type" : "application/json",
            "Access-Control-Allow-Headers" : "DNT,Keep-Alive,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type,Range,Authorization,Content-Type, Content-Length, X-Content-Length, Access-Control-Allow-Origin, User-Agent, authorization, Authorization, x-signature, token, epiProtocolVersion, getProductData",
            "Access-Control-Allow-Origin": "*",
            "Access-Control-Allow-Methods": "OPTIONS,POST,PUT,GET,PATCH,DELETE"
}

After configuring this the scan is successful in DEV (dev.epi domain):

image

image

jaravan1 commented 1 year ago

Will be resolved with https://github.com/PharmaLedger-IMI/epi-workspace/issues/1143