Open Bug 1919787 Opened 2 years ago Updated 2 years ago

Form method "post" on local file results in Firefox sending GET

Categories

(Core :: DOM: Forms, defect)

Firefox 130
defect

Tracking

()

UNCONFIRMED

People

(Reporter: Hi-Angel, Unassigned)

Details

User Agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) QtWebEngine/6.7.2 Chrome/118.0.5993.220 Safari/537.36

Steps to reproduce:

When form tag has set method="post", Firefox ignores it and sends GET instead. I tested the same code I use below here https://onecompiler.com/html/42snaucbm and there pressing the button results in an error showing POST, i.e. it works as expected.

  1. Open HTML file that looks as follows:

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>title</title>
</head>
<body>
<form action="tip.php" method="post">
<input type="submit" value="Test">
</form>
</body>
</html>

  1. Press F12 to open debugging tools and click "Network tab"
  2. Press Test button

Actual results:

The "Network" tab shows GET getting sent

Expected results:

The "Network" tab should've showed POST being sent

The Bugbug bot thinks this bug should belong to the 'Core::Networking' component, and is moving the bug to that component. Please correct in case you think the bot is wrong.

Component: Untriaged → Networking
Product: Firefox → Core

So, I found out that it seems FF only has this problem when a POST would get sent to what looks like a local file. To be more specific, if in the test above you replace tip.php with http://localhost:8090/tip.php, a POST will get sent as expected.

I'm pretty sure it needs to be fixed somehow though, because I just spent multiple hours trying different options and browsers, and searching for a way to get POST triggered.

Moving this to HTML for initial peek investigation as to why form action is not parsed correctly.
Kindly revert to networking if you see that the request is processed correctly.
Please note that if the request method is not populated in the channel, necko adds a default GET method.

Component: Networking → DOM: Core & HTML
Severity: -- → S3
Component: DOM: Core & HTML → DOM: Forms
Summary: Form method "post" result in Firefox sending GET → Form method "post" on local file results in Firefox sending GET
You need to log in before you can comment on or make changes to this bug.