You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@cordova.apache.org by GitBox <gi...@apache.org> on 2020/06/29 06:06:57 UTC

[GitHub] [cordova-ios] happyi opened a new issue #925: Preflight response is not successful

happyi opened a new issue #925:
URL: https://github.com/apache/cordova-ios/issues/925


   Preflight response is not successful
   
   
   XMLHttpRequest cannot load http://jm.yongdianbao.com.cn/employee/rest/api/login due to access control checks.
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org
For additional commands, e-mail: issues-help@cordova.apache.org


[GitHub] [cordova-ios] breautek commented on issue #925: Preflight response is not successful

Posted by GitBox <gi...@apache.org>.
breautek commented on issue #925:
URL: https://github.com/apache/cordova-ios/issues/925#issuecomment-651989364


   > @timbru31 do you have any tutorial to configure it? Is that possible to configure only from client side or we will need a server side change?
   
   This is a server thing. Providing a tutorial is not really possible, specific instructions will depend on your server stack.
   
   Over simplified instructions would be:
   
   - Respond to the `OPTIONS` method request (reply with no data, but do set `Access-Control` headers).
   - Set `Access-Control-Allow-Methods`, `Access-Control-Allow-Origin`, and `Access-Control-Allow-Headers` in your response headers for `OPTIONS`, `GET`, and `POST` request methods. This is to support both "preflight" request and "simple" requests.
   
   https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS for more detailed information on how CORS protocol works. I would recommend reading.


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org
For additional commands, e-mail: issues-help@cordova.apache.org


[GitHub] [cordova-ios] timbru31 commented on issue #925: Preflight response is not successful

Posted by GitBox <gi...@apache.org>.
timbru31 commented on issue #925:
URL: https://github.com/apache/cordova-ios/issues/925#issuecomment-651008703


   You need to configure proper CORS headers.


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org
For additional commands, e-mail: issues-help@cordova.apache.org


[GitHub] [cordova-ios] breautek commented on issue #925: Preflight response is not successful

Posted by GitBox <gi...@apache.org>.
breautek commented on issue #925:
URL: https://github.com/apache/cordova-ios/issues/925#issuecomment-651994763


   The MDN article lays out the difference between simple requests and non-simple requests. Simple requests do not send a preflight response (the `OPTIONS` request).
   
   And I don't think the web inspector also actually shows the preflight request in the network tab if my memory recalls properly (but I could be wrong... it's been awhile for me). I used postman to debug CORS response issues by hitting the URL endpoint using `OPTIONS` and checking to make sure my response was as expected.


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org
For additional commands, e-mail: issues-help@cordova.apache.org


[GitHub] [cordova-ios] renanbandeira commented on issue #925: Preflight response is not successful

Posted by GitBox <gi...@apache.org>.
renanbandeira commented on issue #925:
URL: https://github.com/apache/cordova-ios/issues/925#issuecomment-651976968


   @timbru31 do you have any tutorial to configure it? Is that possible to configure only from client side or we will need a server side change?


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org
For additional commands, e-mail: issues-help@cordova.apache.org


[GitHub] [cordova-ios] renanbandeira commented on issue #925: Preflight response is not successful

Posted by GitBox <gi...@apache.org>.
renanbandeira commented on issue #925:
URL: https://github.com/apache/cordova-ios/issues/925#issuecomment-652421760


   Thanks, buddy, I could kinda make it work. My server already accepts some cross-origin requests, when origin is file or http://localhost . My problem is that, when I add `<preference name="scheme" value="file"/>` on my `config.xml`, origin header is null. If I add like release notes (scheme app and hostname localhost), origin header is `app://localhost`, but I can't load internal files, such as pictures taken.


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org
For additional commands, e-mail: issues-help@cordova.apache.org


[GitHub] [cordova-ios] renanbandeira commented on issue #925: Preflight response is not successful

Posted by GitBox <gi...@apache.org>.
renanbandeira commented on issue #925:
URL: https://github.com/apache/cordova-ios/issues/925#issuecomment-651992639


   Gotcha, @breautek , thanks. But as far as I can see, the OPTIONS method request is not sent by WkWebview:
   ![image](https://user-images.githubusercontent.com/1872284/86167720-70296d00-baed-11ea-99c8-3e7f5460988b.png)
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org
For additional commands, e-mail: issues-help@cordova.apache.org


[GitHub] [cordova-ios] renanbandeira edited a comment on issue #925: Preflight response is not successful

Posted by GitBox <gi...@apache.org>.
renanbandeira edited a comment on issue #925:
URL: https://github.com/apache/cordova-ios/issues/925#issuecomment-652421760


   Thanks,@breautek  , I could kinda make it work. My server already accepts some cross-origin requests, and now it is working. The only issue I have now is related to cookie session. It doesn't store cookie session response to send to subsequent requests. Do you know how to fix it?


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org
For additional commands, e-mail: issues-help@cordova.apache.org


[GitHub] [cordova-ios] timbru31 closed issue #925: Preflight response is not successful

Posted by GitBox <gi...@apache.org>.
timbru31 closed issue #925:
URL: https://github.com/apache/cordova-ios/issues/925


   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org
For additional commands, e-mail: issues-help@cordova.apache.org