telefonicaid / fiware-pep-steelskin

Telefonica's implementation of the FIWARE PEP GE
GNU Affero General Public License v3.0
0 stars 0 forks source link

add handler for text/plain bodies #346

Closed AlvaroVega closed 7 years ago

AlvaroVega commented 7 years ago

Fixes https://github.com/telefonicaid/fiware-pep-steelskin/issues/345

fgalan commented 7 years ago

I understand this PR solves the forwarding of requests with text/plain MIME type. In the case of Orion, this is the only one request of that case:

PUT /v2/entities/E/attrs/A/value
Content-Type: text/plain

80

But, what about of the reverse? I mean, a request without payload but that causes a response with text/plain. Is this PR solving that case (in negative case I'd suggest to expand it to do so). Example of what I mean:

Request:

GET /v2/entities/E/attrs/A/value
Accept: text/plain

could cause the following respones:

200 OK
Content-Type: text/plain

80
AlvaroVega commented 7 years ago

Regarding with https://github.com/telefonicaid/fiware-pep-steelskin/pull/346#issuecomment-302087801 this PR covers both ways: bodies in request and responses. In the case of

curl -i --insecure -X GET <cb_endpoint>/cb/v2/entities/Car1/attrs/temperature/value -H 'x-auth-token: c506c50ccb014c9b8ca4f6a1767f5958' -H 'fiware-service: smartsegovia' -H 'fiware-servicepath: /' -H 'accept: text/plain'

It was already working

AlvaroVega commented 7 years ago

LGTM

fgalan commented 7 years ago

LGTM