[NETCONF-676] The "Location" returned in response should be right as description in rfc8040 when create resource. Created: 26/Apr/20 Updated: 03/Aug/20 Due: 26/Apr/20 Resolved: 03/Aug/20 |
|
| Status: | Resolved |
| Project: | netconf |
| Component/s: | restconf-nb |
| Affects Version/s: | None |
| Fix Version/s: | Aluminium, Magnesium SR2, Sodium SR4 |
| Type: | Bug | Priority: | Medium |
| Reporter: | wang senxiao | Assignee: | wang senxiao |
| Resolution: | Done | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Issue Links: |
|
||||||||
| Priority: | Normal | ||||||||
| Description |
|
As description in rfc8040 chapter 4.4.1: If the POST method succeeds, a "201 Created" status-line is returned I check feature rfc8040, it returned "Locaiton", but not correct. For example, I tested with this yang: module tapi-common { .......... }module tapi-connectivity { .......... augment "/tapi-common:context" { { key 'uuid'; uses connectivity-service; } } } } When I use postman to create resource "connectivity-service", as rfc8040 example in chapter B.2.1 described, the "Location" in response shoulde be this, bring it uuid: But actually returns: Location →http://127.0.0.1:8181/rests/data/tapi-common:context/tapi-connectivity:connectivity-context Besides, the "Content-Type" also should be returned in response, it is the same as the "Content-Type" in the request. |
| Comments |
| Comment by Jamo Luhrsen [ 13/Jul/20 ] |
|
Hi wsx25289, I am not sure if this is working as expected or not. There are a few things I noticed. 1. when we do a GET on a subscription URI (bierman works) we are not getting a header 2. Above you seem to indicate that the original bug was here so that we also get the Location returned in a 201 response |
| Comment by wang senxiao [ 14/Jul/20 ] |
|
The rfc8040 says "If the POST method succeeds, a "201 Created" status-line is returned and there is no response message-body. A "Location" header field identifying the child resource that was created MUST be present in the response in this case.". But I didn't see the description about location in GET. |
| Comment by Jamo Luhrsen [ 14/Jul/20 ] |
|
correct me if I'm wrong, but I think this bug is still there. We don't see the Location returned in the POST to create, OR in the GET for rfc8040. It is Here are the headers for each case:
{'Set-Cookie': 'JSESSIONID=node0vl799fp3vr0nz05v66cwslv67.node0;Path=/, rememberMe=deleteMe; Path=/; Max-Age=0; Expires=Wed, 18-Mar-2020 21:42:19 GMT', 'Content-Length': '207', 'Expires': 'Thu, 01 Jan 1970 00:00:00 GMT', 'Content-Type': 'application/xml'}
{'Content-Length': '173', 'Content-Type': 'application/xml', 'Location': 'ws://10.30.170.125:8185/data-change-event-subscription/opendaylight-inventory:nodes/datastore=CONFIGURATION/scope=BASE'}
{'Content-Type': 'application/xml', 'Content-Length': '207'}
{'Content-Type': 'application/xml', 'Content-Length': '179'}
|
| Comment by Jamo Luhrsen [ 16/Jul/20 ] |
|
I think this patch from vladyslav.marchenko might have helped some. At least CSIT Does anyone know if it's a requirement or not that the POST should return the Location in a response header or not? You can see above |
| Comment by Jamo Luhrsen [ 29/Jul/20 ] |
|
vladyslav.marchenko, so you know anything here? I notice that magnesium is still |
| Comment by Vladyslav Marchenko [ 30/Jul/20 ] |
|
I actually don't know if it's a requirement or not. Fixes about location in header in my patch was for restconf-nb-rfc8040. And I did the same as was done in restconf-nb-bierman02. And that was the reason why CSIT failed at the beginning for my patch |
| Comment by Jamo Luhrsen [ 01/Aug/20 ] |
|
Thanks for the help vladyslav.marchenko. Here is a patch to fix Mg: |