FIWARE / context.Orion-LD

Context Broker and CEF building block for context data management which supports both the NGSI-LD and the NGSI-v2 APIs
https://www.etsi.org/deliver/etsi_gs/CIM/001_099/009/01.06.01_60/gs_CIM009v010601p.pdf
GNU Affero General Public License v3.0
50 stars 43 forks source link

JSON-LD Link header in GET requests is reported to be in error but actually it is not #11

Closed jmcanterafonseca closed 5 years ago

jmcanterafonseca commented 5 years ago

Please check the input format at

https://github.com/Fiware/NGSI-LD_Tests/blob/master/contextConsumption/retrieve_entity_with_ldcontext_test.js#L102

kzangeli commented 5 years ago

This seems to be the same as issue #9. Well, in/out. I assumed (from examples) that the Link HTTP Header was simply a URL string. Now I see that was a mistake ...

kzangeli commented 5 years ago

Fixed in https://github.com/Fiware/context.Orion-LD/commit/8b30568691b8bb1a914cca34628fd41bfc88f250.

Now the format `Link: ; rel=URL; type=XXX is supported. However, not sure what to with rel and type. Doing nothing right now (I even stop parsing after reaching the end of the URL). If something needs to be done about rel and type, a new issue about this should be created.

jmcanterafonseca commented 5 years ago

this is not fixed

please check

{"body": {"details": "protocol doesn't start with 'http' nor 'https'", "title": "Link HTTP Header must be a valid URL", "type": "http://example.org/ngsi-ld/errors/BadRequestData"}, "headers": {"connection": "close", "content-length": "165", "content-type": "application/json", "date": "Tue, 20 Nov 2018 17:05:24 GMT"}, "request": {"headers": {"Accept": "application/ld+json", "Link": "<https://fiware.github.io/NGSI-LD_Tests/ldContext/testContext2.jsonld>; rel=\"http://www.w3.org/ns/json-ld#context\"; type=\"application/ld+json\""}, "method": "GET", "uri": {"auth": null, "hash": null, "host": "localhost:1030", "hostname": "localhost", "href": "http://localhost:1030/ngsi-ld/v1/entities/urn%3Angsi-ld%3AT%3A1542733523802?attrs=P1", "path": "/ngsi-ld/v1/entities/urn%3Angsi-ld%3AT%3A1542733523802?attrs=P1", "pathname": "/ngsi-ld/v1/entities/urn%3Angsi-ld%3AT%3A1542733523802", "port": "1030", "protocol": "http:", "query": "attrs=P1", "search": "?attrs=P1", "slashes": true}}, "statusCode": 400}
kzangeli commented 5 years ago

This seems to be a problem with the version of orionld. The issue should be fixed. All functests of orionld work with the "new" format of Link HTTP Header. If it fails somehow, I'd need detailed info on the failure.