-
-
Notifications
You must be signed in to change notification settings - Fork 98
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Request changed from HTTP GET to POST #282
Comments
@jfarcand Can you please verify the above issue? |
@swapnilmak Use the |
@jfarcand Thank you for confirming. As I mentioned before, with new behaviour we are sending POST request and I am facing 403 forbidden error. Looks like we are not considering CSRF token while sending this request. And because of that the backend is complaining. |
@swapnilmak Are you saying the POST is missing some query params, missing your CSRF token? Just give me an example of what is sent back to the server. |
For all GET methods, there is no problem. Just for this navigator.sendBeacon(POST method), I am getting this 403 error. Please find below the information: General:
Response Headers:
Request Headers:
|
I closed it by mistake. |
OK I suspect the problem is from the way your server is configured. Can you share what the GET request looks like? |
GET request is as below: General:
Response Headers:
Request Headers: |
@jfarcand Did you get a chance to look at the GET request? |
Hi @jfarcand, I appreciate your time, and I hope that you have had an opportunity to review my previous comment. As you can see in the GET request, in the old version of Atmosphere 2.5.12(AtmosphereJS 2.3.9), the atmosphere it's adding the CRSF Token value in the http header, but in the new version of Atmosphere 2.7.6(AtmosphereJS 3.1.3), the atmophere does not add the CRSF Token value in the http header this time for the POST Request. Is there a way to pass CSRF token in this POST request too? I would appreciate you if you could introduce this change in the next version of Atmosphere. |
I have upgraded the Atmosphere version from 2.5.12 to 2.7.6 and the atmosphere javascript version from 2.3.9 to 3.1.3 in my application.
I noticed the below change in the latest atmosphere javascript version in the _pushOnClose method.
if (_request.unloadBackwardCompat) {
_executeRequest(rq);
} else {
navigator.sendBeacon(rq.url, rq.data);
}
In the previous version, there was no such if condition. So, it was always executing the _executeRequest method(HTTP GET method) whenever we close the socket connection.
In the new version, as we are using unloadBackwardCompat as false, it is always executing else block and sending HTTP POST request. For this POST request, I am getting a 403 forbidden error.
Can you please confirm whether it is a bug? And let me know the purpose of this unloadBackwardCompat.
Also, I wanted to confirm whether this "rq" object is configurable externally? Can we set rq.unloadBackwardCompat to true?
Atmosphere Info
Systems:
The text was updated successfully, but these errors were encountered: