Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Incorrect detection of wrong URLs at notification time #1652

Closed
fgalan opened this issue Jan 11, 2016 · 3 comments
Closed

Incorrect detection of wrong URLs at notification time #1652

fgalan opened this issue Jan 11, 2016 · 3 comments
Assignees
Labels
Milestone

Comments

@fgalan
Copy link
Member

fgalan commented Jan 11, 2016

It seems that Orion (as in 0.26.1) allows create subscriptions which reference is port 0 (ilegal, as port ranges from 1 to 65535):

time=2016-01-11T12:29:20.204CET | lvl=INFO | trans=1452511738-622-00000000337 | function=LM_TRANSACTION_START | comp=Orion | msg=logMsg.h[1792]: Starting transaction to foo.bar.net:0/ngsi10/notifyContext
time=2016-01-11T12:29:20.204CET | lvl=ERROR | trans=1452511738-622-00000000337 | function=httpRequestSendWithCurl | comp=Orion | msg=httpRequestSend.cpp[220]: Runtime Error (port is ZERO)
time=2016-01-11T12:29:20.204CET | lvl=INFO | trans=1452511738-622-00000000337 | function=LM_TRANSACTION_END | comp=Orion | msg=logMsg.h[1815]: Transaction ended

Thus, probably reference should be checked at subscription creation/update time, in order to detect ilegal port (and maybe other URL checkings).

@fgalan fgalan added this to the 0.27.0 milestone Jan 11, 2016
@fgalan
Copy link
Member Author

fgalan commented Jan 11, 2016

Taking into account the content of the DB:

"reference" : "http://foo.bar.net/ngsi10/notifyContext/dev-fixed",

The problem is not related with ilegal port at subscription time, but with incorrectly not setting the default to 80.

@fgalan fgalan changed the title Avoid subscription to ilegal ports Incorrect http default port in notifications Jan 11, 2016
@fgalan fgalan self-assigned this Jan 11, 2016
@fgalan
Copy link
Member Author

fgalan commented Jan 11, 2016

After more research, the problem is due the following strings are not detected as wrong URL:

http://http://XXX:1234/path
http://XXX:/path

Adjusting parseUrl() solves the issue. I'll take care.

@fgalan fgalan changed the title Incorrect http default port in notifications Incorrect detection of wrong URLs at notification time Jan 11, 2016
@fgalan
Copy link
Member Author

fgalan commented Jan 12, 2016

Fixed in PR #1653

@fgalan fgalan closed this as completed Jan 12, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant