ging / fiware-pep-proxy

Support for proxy functions within OAuth2-based authentication schemas. Also implements PEP functions within an XACML-based access control schema.
https://fiware-pep-proxy.rtfd.io/
MIT License
27 stars 47 forks source link

Docker versions of 8.1.0 and 8.3.0 return wrong mime type text/html since last image version #144

Closed Siedlerchr closed 1 year ago

Siedlerchr commented 1 year ago

After I did a docker pull last week, suddenly the docker container started to return the wrong mime type text/html instead of application/json. I see that 8.1.0 was updated 13 days ago: https://hub.docker.com/layers/fiware/pep-proxy/8.1.0/images/sha256-3a57d2551863a88fc6bdd9a4c7cc7a2771010f81a3c12d7282dc35ec490e240c?context=explore

I also tested 8.3.0, but it exhibits the same behavior.

Using curl it returns: curl -i --location --request GET 'http://172.18.1.16:1027/v2/entities/urn:ngsi-ld:Test:123456' -H 'Accept: application/json' -H 'Authorization: Bearer 1234'

HTTP/1.1 200 OK
Access-Control-Allow-Origin: *
Access-Control-Allow-Credentials: true
Content-Type: text/html; charset=utf-8
Content-Length: 1005
ETag: W/"3ed-eQEVzw6/98cZxhY/fsr5D/3VJBw"
Date: Wed, 02 Nov 2022 09:42:27 GMT
Connection: keep-alive
Keep-Alive: timeout=5

On another server which I did not yet update, I got the correct response for 8.1.0: Working version 8.1.0 hash: "Image": "sha256:1a7a42f75de7c12a2e607c094d4b6e9b7277e17b4b7c44adbc97edab0f8e5835",

curl -i --location --request GET 'http://172.18.1.16:1027/v2/entities/urn:ngsi-ld:Test:123456' -H 'Accept: application/json' -H 'Authorization: Bearer 1234'

HTTP/1.1 200 OK
Connection: Keep-Alive
Content-Length: 1005
Content-Type: application/json
Fiware-Correlator: cca15c68-5a92-11ed-a198-0242ac120114
Date: Wed, 02 Nov 2022 09:43:26 GMT
Siedlerchr commented 1 year ago

@jason-fox Dockerhub shows that you were the latest to push these images. Do you have any idea what could be wrong?

jason-fox commented 1 year ago

The FIWARE version is just a clone of the GING original: https://hub.docker.com/r/ging/fiware-pep-proxy/tags

jason-fox commented 1 year ago

It looks like Express has been updated to return Content-type text/html unless explicitly set. It would be a simple PR to fix it.