pp::URLLoader.Open callback returns PP_ERROR_NOACCESS for POST even though the request succeed.
76 views
Skip to first unread message
oh...@beamr.com
unread,
Jul 17, 2016, 10:28:12 AM7/17/16
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Sign in to report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to Native-Client-Discuss
Hi,
I have the following scenario:
Server A with pnacl
When the client browse to server A the pnacl code is doing http POST to server B using pp::URLLoader.Open().
The call succeed but still the Open callback gets error -7 (PP_ERROR_NOACCESS)
Here is the code snippet:
pp::URLRequestInfo* _req;
pp::URLLoader* _urlLoader;
// ...
_req->SetURL(_url);
_req->SetMethod("POST");
_req->SetAllowCrossOriginRequests(true);
_urlLoader->Open(*_req, cc);
// the callback gets -7 later.
Can anyone explain to me why I get the -7 result?
Thanks.
Bill Budge
unread,
Jul 18, 2016, 10:04:28 AM7/18/16
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Sign in to report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to Native-Client-Discuss
It's impossible to say for sure without seeing the response. But PPB_URLLoader follows the CORS standard for cross origin requests, so I would guess that either your request didn't follow CORS rules, or the server doesn't support CORS responses. Here's a link to the standard:
You do not have permission to delete messages in this group
Copy link
Report message
Sign in to report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to Native-Client-Discuss
I'm seeing the same behavior as OP. I'm making a CORS request using pp::URLLoader which completes successfully (both the preflight OPTIONS request as well as the actual POST), however Open() returns PP_ERROR_NOACCESS (-7).
I'm doing this using a pexe loaded into the context of a normal webpage. I'm not doing extension development (where the same request works just fine, with the same settings and options).
I know the requests have completed successfully because I can watch the entire exchange using the page's dev tools.
One possible issue: I am currently forcing the CORS preflight response using Fiddler. I've considered that the issue could be setting Access-Control-Max-Age to 1 in the preflight response, and then not including the same Access-Control-Allow-Origin header in the POST response, so I'm going to see if I can modify that response to also include the CORS security headers. However this is strange behavior. I can clearly see the request be completed with the dev tools, but I'm still getting PP_ERROR_NOACCESS as the return from Open().
Request data below:
Here is the original OPTIONS request made by the PNaCl component using URLLoader: