[CONTROLLER-130] cannot interpret '/' in urls Created: 22/Jan/14 Updated: 25/Jul/23 Resolved: 21/Feb/14 |
|
| Status: | Resolved |
| Project: | controller |
| Component/s: | restconf |
| Affects Version/s: | None |
| Fix Version/s: | None |
| Type: | Improvement | ||
| Reporter: | Dana Kutenicsova | Assignee: | Unassigned |
| Resolution: | Done | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Environment: |
Operating System: Linux |
||
| Description |
|
If an element id contains '/' (encoded to %2F), restconf is unable to generate xml output and fails to do so without any warning (site, stdout, log). |
| Comments |
| Comment by shweta rao [ 27/Jan/14 ] |
|
I am able to replicate this bug and working to debug the same |
| Comment by Priyanka Chopra [ 29/Jan/14 ] |
|
Hi, I am able to replicate the bug by following the below mentioned steps: <?xml version="1.0" encoding="UTF-8" standalone="no"?> The flow gets created and RESPONSE is 200 ok. When I hit the below URI it fails to generate the xml. Following are my observations: 1.) pathArgs array is created by slicing the above URI based on "/" delimiter. ControllerContext.java public InstanceIdWithSchemaNode toInstanceIdentifier(final String restconfInstance) { So the logic understands flow ID - "22/" as "22" while fetching value from the URI. 2.) The logic can be augmented to allow users to create and retrieve flow with flow ID "22/" in URI, while the created flow in DB will still be of ID 22, thus enabling the user to get proper xml. Request you to please confirm if this is the expected implementation. |
| Comment by Priyanka Chopra [ 30/Jan/14 ] |
|
https://git.opendaylight.org/gerrit/#/c/5014/ logic has been augmented to allow users to create and retrieve flows having "/" in flow ID. The user gets a proper xml while retrieving the flow. Thanks |
| Comment by Tony Tkacik [ 30/Jan/14 ] |
|
Priyanka Chopra: This bug also deeps down more, because tomcat does not allow %2f in URL or deecodes them to "/" so restconf does not get original view of URI supplied by the user. This requires further investigation in Jersey and Tomcat configuration in container, to find right combination when escaping will get passed to the restconf. |
| Comment by Priyanka Chopra [ 07/Feb/14 ] |
|
Hi Tony, We can configure the server to allow encoded characters in origin. Although only doing this will not fix Have attached the snippet below: public InstanceIdWithSchemaNode toInstanceIdentifier(final String restconfInstance) { Moreover this bug is closely related with Thanks |
| Comment by Jozef Gloncak [ 17/Feb/14 ] |
|
The patch which should solve this issue was commited It also is necessary to insert line It was also necessary to use @Encoded anotation before method parameters which should hold identifier in RestconfService.java interface. The annotation disables automatic decoding of specific characters from URI. So it is possible to resolve %2F in methods of RestconfService interface. Example |
| Comment by Jozef Gloncak [ 21/Feb/14 ] |
|
commit was merged |