I’m having problems with my login form. When sending data (email and password), they arrive empty on the server. In fact, neither the fields nor their respective values are passed on.
This error happens from time to time. I realized that if the page is reloaded, or if some time has passed, and I try to login again, it passes. I am using Angular 5 (SPA) with Laravel 5.4 and PHP 5.6 on the server.
I have already tested it with chrome / firefox browsers and postman. If I disable cloudflare, the error does not happen.
I’ve made a video showing the problem: https://youtu.be/nRuF0UPgaKQ
Hello everyone again!
One more detail that I noticed: if I log in first on the computer and then on the smartphone, it gives an error. If by chance I update the page on the computer and then try to login on the smartphone, it accepts and does not present errors.
I forgot to mention in the post that I am making the request using http post sending a json to the server.
Can you check if the response had been cached by Cloudflare?
Look for the response header
Thanks for answering Eric!
Then, the server is returning the “cf-cache-status: Dynamic” attribute in the response header. Searching, I saw that Dynamic means that the content is not being cached.
Any other tips?
Edit: below are the response and request headers:
HTTP/2 405 Method Not Allowed
date: Sun, 17 Jan 2021 14:35:31 GMT
content-type: text/html; charset=UTF-8
access-control-allow-headers: Origin, Content-Type, X-Auth-Token
cache-control: no-cache, private
expect-ct: max-age=604800, report-uri=“https://report-uri.cloudflare.com/cdn-cgi/beacon/expect-ct”
POST /api/authenticate/login HTTP/2
User-Agent: Mozilla/5.0 (Windows NT 6.3; Win64; x64; rv:84.0) Gecko/20100101 Firefox/84.0
Accept: application/json, text/plain, /
Accept-Encoding: gzip, deflate, br
Cookie: __cfduid=df1806551ad4c421270cc6825a93b82f31610893939; io=rR6MNqWHzdiSPG1-AACg; cookieconsent_status=dismiss
Is HTTP 405 response expected?
Can you try disable proxy for the subdomain, wait for few minutes and try whether you still get the same issue?
If yes, then probably something happened on your server side.
Eric, error 405 is not expected.
What happens is that in those times that the error happens, the parameter does not reach the server. And because POST is going empty, apache is interpreting POST as GET. When it arrives on the routes, there is no GET method at this endpoint, and then the error happens.
That’s basically it. When I remove the proxy, the error stops happening!
This topic was automatically closed 5 days after the last reply. New replies are no longer allowed.