Strange behavior - Request payload

Having problems with building or using CEF's C/C++ APIs? This forum is here to help. Please do not post bug reports or feature requests here.

Strange behavior - Request payload

Postby JoaoCosta » Tue Oct 31, 2017 10:18 am

Hello,

I've recently encountered a strange issue with my application when trying to implement a handler for post data.
The request uses an http scheme with a custom domain. I've implemented the scheme handler for these requests.

I've been getting NULL PostData from the request and when I observe the Request from the dev tools, there is no Payload for the request.

However, I've tried launching the app from a shortcut with the switch --disable-web-security and I'm able to observe the Payload for the request on the dev tools.

I've implemented the following code to disable web security programmatically,

Code: Select all
 
CefRefPtr<CefCommandLine> command_line = CefCommandLine::CreateCommandLine();
command_line->InitFromString(::GetCommandLineW());
command_line->AppendSwitch("disable-web-security");


But even with this code, I'm not able to get the Payload when launching from visual studio.
Only the shortcut with the switch works.

What could be the reason for this?
JoaoCosta
Newbie
 
Posts: 6
Joined: Tue Oct 10, 2017 3:11 am

Re: Strange behavior - Request payload

Postby magreenblatt » Tue Oct 31, 2017 10:48 am

Are you making the request between two different origins? If so, you're probably getting errors in the DevTools console about the request being blocked due to mixed content. Try using https instead of http with your scheme handler.
magreenblatt
Site Admin
 
Posts: 12408
Joined: Fri May 29, 2009 6:57 pm

Re: Strange behavior - Request payload

Postby JoaoCosta » Thu Nov 02, 2017 9:35 am

Hello,

I was indeed using a custom scheme and making a cross origin request to the http.
I've now fixed it by using only the http scheme and avoiding the hassles that come from using custom schemes.

Thank you again for your help.
JoaoCosta
Newbie
 
Posts: 6
Joined: Tue Oct 10, 2017 3:11 am


Return to Support Forum

Who is online

Users browsing this forum: Google [Bot] and 58 guests

cron