Websocket request having origin header null in CEF

Do not post support requests, bug reports or feature requests. Discuss CEF here. Non-CEF related discussion goes in General Discussion!

Websocket request having origin header null in CEF

Postby vbnsit » Wed Feb 02, 2022 7:50 am

Hello everybody,

We recently upgraded CEF from 4324 to 4606 version . we are using websocket(ws:// schema) via javascript to connect to a service on local host .
in 4324 version the origin header is being passed as "file://" but in 4606 origin header is "null"
we have a check at the service for localhost or file:// to be only valid values in origin
ws:// is a standard schema i am not sure why null is being passed for it.
can anybody suggest any workaround/solution for either changing its origin header value or any other way and why this change has been done ?
to me fix for https://bitbucket.org/chromiumembedded/cef/issues/3105 this issue might have introduced this change
Please suggest
Screenshot 2022-02-02 at 6.10.48 PM.png
Screenshot 2022-02-02 at 6.10.48 PM.png (89.9 KiB) Viewed 24176 times
vbnsit
Techie
 
Posts: 13
Joined: Mon Feb 03, 2020 1:09 am

Re: Websocket request having origin header null in CEF

Postby magreenblatt » Wed Feb 02, 2022 10:50 am

How does it behave in Google Chrome at the same version?
magreenblatt
Site Admin
 
Posts: 12382
Joined: Fri May 29, 2009 6:57 pm

Re: Websocket request having origin header null in CEF

Postby vbnsit » Thu Feb 03, 2022 3:13 am

magreenblatt wrote:How does it behave in Google Chrome at the same version?

the behaviour is same null is passed in origin header for same Google Chrome version
any suggestions on this how to have previous behaviour and why it is changed?
vbnsit
Techie
 
Posts: 13
Joined: Mon Feb 03, 2020 1:09 am

Re: Websocket request having origin header null in CEF

Postby magreenblatt » Thu Feb 03, 2022 10:47 am

in 4324 version the origin header is being passed as "file://" but in 4606 origin header is "null"

Are you initializing the websocket request from a file URL? Origin being "null" for file URLs is expected behavior according to https://developer.mozilla.org/en-US/doc ... escription
magreenblatt
Site Admin
 
Posts: 12382
Joined: Fri May 29, 2009 6:57 pm

Re: Websocket request having origin header null in CEF

Postby vbnsit » Thu Feb 03, 2022 4:46 pm

magreenblatt wrote:
in 4324 version the origin header is being passed as "file://" but in 4606 origin header is "null"

Are you initializing the websocket request from a file URL? Origin being "null" for file URLs is expected behavior according to https://developer.mozilla.org/en-US/doc ... escription

websocket request is initialzed with "ws://" URL like ("ws://127.0.0.1:59536/?version=16&token=565656-786-4e2d-778-667)
the javascript file which has websocket request code is loaded from local file system in CEF possibly that is leading to "file://" in 4324 version ?
i am thinking to build CEF with reverting this patch
(https://bitbucket.org/chromiumembedded/ ... 1397.patch ) which probably introduced the change to null
can you suggest if this could be the solution for now or any other ways to handle it?
vbnsit
Techie
 
Posts: 13
Joined: Mon Feb 03, 2020 1:09 am

Re: Websocket request having origin header null in CEF

Postby magreenblatt » Thu Feb 03, 2022 5:23 pm

I don't think that patch file is related. Why is the "null" origin header a problem for you?
magreenblatt
Site Admin
 
Posts: 12382
Joined: Fri May 29, 2009 6:57 pm

Re: Websocket request having origin header null in CEF

Postby vbnsit » Fri Feb 04, 2022 4:45 am

magreenblatt wrote:I don't think that patch file is related. Why is the "null" origin header a problem for you?

Yes that patch file is not related it didn't work on reversing it.
"null" origin is blocker for our client application release as we cannot change the server part for now (service running on localhost along with client application) as there release is freezed and rolled out .
For the long term we will add the null handling but currently since this change came as a surprise in CEF we are trying to figure if we can have any workaround/solution in CEF for our client release
on further digging i found the "null" change started from 4515 version (the first beta build of 4515 also had the issue checked on spotify ) can you guide on any commits or changes in 4515 which led to this change ? In first few commits of 4515 the change occurred . Attaching images of 4472 and 4515 CEF version websocket request headers
Attachments
4515.png
4515.png (83.25 KiB) Viewed 24091 times
4472.png
4472.png (94.49 KiB) Viewed 24091 times
vbnsit
Techie
 
Posts: 13
Joined: Mon Feb 03, 2020 1:09 am

Re: Websocket request having origin header null in CEF

Postby magreenblatt » Fri Feb 04, 2022 11:42 am

Code: Select all
can you guide on any commits or changes in 4515 which led to this change ?

Sorry, I can't. You will need to fix your client not to use file URLs, or fix your server's origin expectations. Consider hosting the file contents via a standard scheme (like http) as documented here. Then the origin can be whatever you choose (like "myapp.com").
magreenblatt
Site Admin
 
Posts: 12382
Joined: Fri May 29, 2009 6:57 pm


Return to CEF Discussion

Who is online

Users browsing this forum: No registered users and 19 guests