fiware-orion icon indicating copy to clipboard operation
fiware-orion copied to clipboard

Wrong forwarding URL when registrateion URL omits path

Open fgalan opened this issue 4 years ago • 6 comments

(Comes from discussion at https://github.com/FIWARE/specifications/issues/13)

Rule to compose forwarding URL for Context Providers is as follow:

  • Queries: <url as used in context registration> + "/op/query"
  • Update: <url as used in context registration> + "/op/update"

When the URL in the registration doesn't omit path (e.g. "http://iot-agent:1880/v2" or "http://iot-agent:1880/") this works fine and the rule is applied correctly, i.e:

  • "http://iot-agent:1880/v2" + "/op/query" = "http://iot-agent:1880/v2/op/query"
  • "http://iot-agent:1880/" + "/op/query" = "http://iot-agent:1880//op/query" (in this case the // is weird, but it what the user wants if he/she uses "http://iot-agent:1880/" in the registration URL)

However, if the URL in the registration omits path (e.g. "http://iot-agent:1880") then is not working correctly: instead of "http://iot-agent:1880/op/query" we get "http://iot-agent:1880//op/query"

fgalan avatar Feb 02 '21 07:02 fgalan

@piwo1984 could you have a look to check if my description of the issue above is fully correct, please? Thanks!

fgalan avatar Feb 02 '21 07:02 fgalan

Rule to compose forwarding URL for Context Providers is as follow:

I'm not sure if that rule is explicitly specified in documentation (https://fiware-orion.readthedocs.io/en/master/user/context_providers/index.html). In negative case, as part of this issue, documentation should be modified to include it.

fgalan avatar Feb 02 '21 07:02 fgalan

@fgalan yes your description is correct.

piwo1984 avatar Feb 02 '21 14:02 piwo1984

Hi @fgalan Sir,

I would like to work on this issue, Please let me know this issue still need a fix or not?

Anjali-NEC avatar Feb 01 '22 15:02 Anjali-NEC

@Anjali-NEC the issue is still valid. Thanks for your willingness to work on it!

The difficult thing here is maybe to create the .test to assess the fix, as you need to inspect the URL to which the request is forwarded in order to check that it's working as expected. Not sure right now if accumulator-server.py could be used in that way (maybe need to be extended with an ad hoc route).

fgalan avatar Feb 01 '22 17:02 fgalan

@Anjali-NEC the issue is still valid. Thanks for your willingness to work on it!

The difficult thing here is maybe to create the .test to assess the fix, as you need to inspect the URL to which the request is forwarded in order to check that it's working as expected. Not sure right now if accumulator-server.py could be used in that way (maybe need to be extended with an ad hoc route).

Due to complexity for creating the .test for this issue, I looking for another issue.

Anjali-NEC avatar Feb 02 '22 07:02 Anjali-NEC