Skip to content
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

Chyba "405 Method Not Allowed" #163

Open
TomiBelan opened this issue Feb 5, 2025 · 0 comments
Open

Chyba "405 Method Not Allowed" #163

TomiBelan opened this issue Feb 5, 2025 · 0 comments

Comments

@TomiBelan
Copy link
Member

Podľa apache/gunicorn access logu máme veľa 405 errorov, z čoho veľká časť sú requesty "POST /?action=mojeSkusky" a podobne. User agent je vždy Safari na iOS alebo macOS.

Môže za to Safari bug https://bugs.webkit.org/show_bug.cgi?id=202963. Viď tiež https://stackoverflow.com/q/46933389. Keď zavoláš history.replaceState() na stránke ktorá prišla ako POST, Safari si stále bude pamätať že je POST a aké bolo telo requestu, len na inej url. Ak užívateľ refreshne, Safari pošle POST so starým telom na novú url. Ostatné prehliadače pri history.replaceState() zmenia metódu na GET a telo zahodia.

Unfun facts:

  • v Chrome to fixli v https://issues.chromium.org/issues/41011857 ale bohužiaľ až potom čo sa Blink forkol
  • bol aj starší bug https://bugs.webkit.org/show_bug.cgi?id=76721 ktorý fixli pred Blink forkom, ale bohužiaľ sa týka iba volania location.reload() apod, nie keď užívateľ manuálne refreshne
  • za čias týchto dvoch bugov spec jasne vravel že z POST sa má stať GET, ale odvtedy sa spec tisíckrát skomplikoval a teraz už tam nič také neviem nájsť, takže čisto technicky vzaté, kto vie kto má vlastne "pravdu"

Náš problém začal pri prechode na SAML, lebo "POST /saml_acs" priamo renderuje app_response.

Tým pádom asi musíme prestať používať history.replaceState() a začať robiť klasický POST-redirect-GET.

TomiBelan added a commit that referenced this issue Feb 5, 2025
Mitigates issue #163 (405 errors on refresh in Safari). Login errors are still
unsolved.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

1 participant