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

in POST v2/subscriptions if httpCustom url is empty the subcription is created #2279

Closed
iariasleon opened this issue Jun 15, 2016 · 3 comments
Assignees
Milestone

Comments

@iariasleon
Copy link
Contributor

in POST v2/subscriptions if notification httpCustom url is empty the subcription is created

subscription request

POST http://qa-orion-fe-02:1026/v2/subscriptions
headers:
    Content-Type: application/json
    Fiware-Service: test_notif_http_custom_url_error
    Fiware-ServicePath: /test
payload: {"notification": {"httpCustom": {"url": ""}, "attrs": ["temperature"]}, "expires": "2016-04-05T14:00:00.00Z", "subject": {"entities": [{"idPattern": ".*"}], "condition": {"attrs": ["temperature"]}}}

subcription response

http code: 201 - Created
headers:
   date: Wed, 15 Jun 2016 11:14:09 GMT
   fiware-correlator: 47e3b3d0-32ea-11e6-be09-005056a20feb
   connection: Keep-Alive
   content-length: 0
   location: /v2/subscriptions/57613940451e58b1a26c24b2

mongo doc

{ "_id" : ObjectId("57613940451e58b1a26c24b2"), "expiration" : NumberLong(1459864800), "reference" : "", "custom" : true, "throttling" : NumberLong(0), "servicePath" : "/test", "status" : "active", "entities" : [ { "id" : ".*", "isPattern" : "true" } ], "attrs" : [ "temperature" ], "blacklist" : false, "conditions" : [ { "type" : "ONCHANGE", "value" : [ "temperature" ] } ], "expression" : { "q" : "", "geometry" : "", "coords" : "", "georel" : "" }, "format" : "normalized" }

expected response

http code: 400 - Bad Request
payload: {"error":"BadRequest","description":"Invalid URL parsing notification url"}

@iariasleon
Copy link
Contributor Author

Re-tested in the CB version. It issue still fails and returns 201-Created

  "version" : "1.2.0-next",
  "git_hash" : "d81dcf28e71d8d63dc0929ef7a6b73d7db47421b"

@fgalan
Copy link
Member

fgalan commented Jan 16, 2017

Fixed in PR #2815. Please @iariasleon check (once the PR gets merged).

@iariasleon
Copy link
Contributor Author

CB version used:

  "version" : "1.6.0-next",
  "git_hash" : "6232159b397f40aff97abd497b1e142a510e3e6d",

LGTM

http code: 400 - Bad Request
headers:
   Connection: Keep-Alive
   Content-Length: 59
   Content-Type: application/json
   Fiware-Correlator: 7d5f872c-dbf1-11e6-8d21-005056a20feb
   Date: Mon, 16 Jan 2017 13:41:31 GMT
payload: {"error":"BadRequest","description":"invalid custom /url/"}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants