[CONTROLLER-278] Unable to use websocket notifications from browsers Created: 07/Apr/14 Updated: 14/Nov/17 Resolved: 19/Mar/15 |
|
| Status: | Resolved |
| Project: | controller |
| Component/s: | restconf |
| Affects Version/s: | Helium |
| Fix Version/s: | None |
| Type: | Improvement | ||
| Reporter: | Zoltan Lajos Kis | Assignee: | Zoltan Lajos Kis |
| Resolution: | Done | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Environment: |
Operating System: Linux |
||
| Attachments: |
|
||||||||||||
| Issue Links: |
|
||||||||||||
| Description |
|
To subscribe to websocket notifications, we need to request the location by sending a get request to "http://<host>:<port>/restconf/streams/stream/<path>", which returns the location in the "Location" header. However, this header is unsafe and is disabled in web browsers by default. To let browsers check this field, the web server must explicitly specify this header as exposed. This can be enabled in the configuration of the CORS filter for sal-rest-connector. See attached diff. |
| Comments |
| Comment by Zoltan Lajos Kis [ 07/Apr/14 ] |
|
Attachment sal-rest-connector.diff has been added with description: configuration diff for sal-rest-connector |
| Comment by Tony Tkacik [ 21/Jul/14 ] |
|
It is possible to update cors filter in controller |
| Comment by Jozef Gloncak [ 25/Sep/14 ] |
|
I tested it. 200 OK Location is there |
| Comment by Jozef Gloncak [ 26/Sep/14 ] |
|
I also tested it in internet explorer 11 with add on DebugBar. After GET request on stream link I got following response HTTP/1.1 200 OK So please specify more details about this problem or steps how to reproduce it. |
| Comment by Zoltan Lajos Kis [ 26/Sep/14 ] |
|
I ran the attached script in Chrome when I reported the bug. (Note, it uses d3.js). If I remember correctly, when calling getResponseHeader("Location"), Chrome rejected and reported that it is unsafe. |
| Comment by Zoltan Lajos Kis [ 26/Sep/14 ] |
|
Attachment gui2.tar.gz has been added with description: JS to reproduce the bug |
| Comment by Jozef Gloncak [ 26/Sep/14 ] |
|
I wasn't able to replicate it via your java script. I prepared lightweight version (see below) but neither it was possible to replicate. } Therefore I prepared patch as you suggested. |
| Comment by Zoltan Lajos Kis [ 26/Sep/14 ] |
|
It's quite possible this has been fixed since; there have been so many refactorings in the past six months. I don't have the tools right now to test if this has been fixed or if the patch is necessary. If you see the bug gone, just close the ticket. If anyone experiences it again, it'll be here for reopening... |
| Comment by Jozef Gloncak [ 29/Sep/14 ] |
|
as I wrote I couldn't replicate this issue. If you have time please test it. |