POST is not correctly encoding form-date when fewer than two elements are "successful"

RESOLVED WORKSFORME

Status

()

Core
HTML: Form Submission
RESOLVED WORKSFORME
15 years ago
15 years ago

People

(Reporter: resigned, Unassigned)

Tracking

Trunk
x86
Linux
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment)

(Reporter)

Description

15 years ago
User-Agent:       Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.3) Gecko/20030312
Build Identifier: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.3) Gecko/20030312

According to the HTML 4 spec, when there are "successful" elements in the form,
they should be encoded as part of the post. Where no enctype is specified,
Mozilla appears to default to "application/x-www-form-urlencoded", and do so
correctly, but...

...if there is onlly one successful control (e.g. just the "input type=submit"
button that was pressed) then the form is submitted as
"application/x-www-form-urlencoded" but WITHOUT the HTTP "Content-Type" field.
C.f. the example attached.

Reproducible: Sometimes

Steps to Reproduce:
1.submit the attached form by pressing the "cleargame" button
2.
3.

Actual Results:  
Mozilla sends this:

POST /admin/mgmt-game HTTP/1.1
Host: 192.168.0.104:3000
User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.3) Gecko/20030312
Accept:
text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,video/x-mng,image/png,image/jpeg,image/gif;q=0.2,*/*;q=0.1
Accept-Language: en,en-us;q=0.5
Accept-Encoding: gzip,deflate,compress;q=0.9
Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7
Keep-Alive: 300
Connection: keep-alive
Referer: (OMITTED DUE TO SECURITY)
Cookie: (OMITTED DUE TO SECURITY)
Content-Length: 16

submit=cleargame

Expected Results:  
There should have been an extra header-field:
"Content-Type: application/x-www-form-encoded"

<html>
	<body>
		<table>
			<tr><td>You are logged in as:</td><td>"admin"</td></tr>
		</table>
		<h1>ADMIN page - Game Management</h1>
		
		<font color="#FF0000">NOTE: This module automatically creates hundreds of clubs,
			thousands of players, and provisionally arranges most - if not all - matches.
			Use it with caution! Especially do NOT use it with an already-running game,
			unless you reset the entire game</font>

		
		<h2>Reload templates</h2>
		
		This just reloads the HTML templates that each page uses to format the data it
displays.
		The main use for this is when web-designers are altering the HTML templates,
and want
		the server to re-read the new template files without restarting the server.
		<p/>
		<table border="1">
			<form action="/admin/mgmt-game" method="post">
				<input type="submit" name="submit" value="reloadtemplates">Reload
Templates</input>
			</form>
		</table>

		
		
		<h2>Reset game</h2>
		
		<table border="1">
			<form action="/admin/mgmt-game" method="post">
				<input type="submit" name="submit" value="cleargame">Clear / erase game:
removes all game data</input>
			</form>
		</table>
<h2>Initialise game</h2>

		Note: this assumes the game is currently empty; the results are unpredictable if
		called upon a game which already has some data. In particular, the
matches/fixtures
		database will probably be screwed up.
		
		<form action="/admin/mgmt-game" method="post">
			<table>
				<tr>
					<th>Squad Type</th><th>Division (0,1,2,3)</th><th>Skill points to
allocate</th><th>minAge</th><th>maxAge</th><th>min StartingSkill</th><th>max
StartingSkill</th><th>min MaximumSkill</th><th>(currently unused)max
MaximumSkill</th>

				</tr>
				
				<tr>
					<td>
						100
					</td>
					<td>
						0
					</td>
					<td>
						<input type="text" name="parameter.skillpoints.100.0" value="1000" />

					</td>
					<td>
						<input type="text" name="parameter.agemin.100.0" value="21" />

					</td>
					<td>
						<input type="text" name="parameter.agemax.100.0" value="36" />

					</td>

					<td>
						<input type="text" name="parameter.skillmin.100.0" value="1" />

					</td>
					<td>
						<input type="text" name="parameter.skillmax.100.0" value="100" />

					</td>
					<td>
						<input type="text" name="parameter.maxskillmin.100.0" value="70" />

					</td>
				</tr>
				<tr>
					<td>
						100
					</td>
					<td>
						1
					</td>

					<td>
						<input type="text" name="parameter.skillpoints.100.1" value="1000" />

					</td>
					<td>
						<input type="text" name="parameter.agemin.100.1" value="21" />

					</td>
					<td>
						<input type="text" name="parameter.agemax.100.1" value="36" />

					</td>
					<td>
						<input type="text" name="parameter.skillmin.100.1" value="1" />

					</td>
					<td>
						<input type="text" name="parameter.skillmax.100.1" value="100" />

					</td>

					<td>
						<input type="text" name="parameter.maxskillmin.100.1" value="70" />

					</td>
				</tr>
				<tr>
					<td>
						100
					</td>
					<td>

						2
					</td>
					<td>
						<input type="text" name="parameter.skillpoints.100.2" value="1000" />

					</td>
					<td>
						<input type="text" name="parameter.agemin.100.2" value="21" />

					</td>

					<td>
						<input type="text" name="parameter.agemax.100.2" value="36" />

					</td>
					<td>
						<input type="text" name="parameter.skillmin.100.2" value="1" />

					</td>
					<td>
						<input type="text" name="parameter.skillmax.100.2" value="100" />

					</td>
					<td>
						<input type="text" name="parameter.maxskillmin.100.2" value="70" />

					</td>
				</tr>
				<tr>
					<td>
						100
					</td>

					<td>
						3
					</td>
					<td>
						<input type="text" name="parameter.skillpoints.100.3" value="1000" />

					</td>
					<td>
						<input type="text" name="parameter.agemin.100.3" value="21" />

					</td>
					<td>
						<input type="text" name="parameter.agemax.100.3" value="36" />

					</td>
					<td>
						<input type="text" name="parameter.skillmin.100.3" value="1" />

					</td>
					<td>

						<input type="text" name="parameter.skillmax.100.3" value="100" />

					</td>
					<td>
						<input type="text" name="parameter.maxskillmin.100.3" value="70" />

					</td>
				</tr>
				<tr>
					<td>

						101
					</td>
					<td>
						0
					</td>
					<td>
						<input type="text" name="parameter.skillpoints.101.0" value="1000" />

					</td>
					<td>

						<input type="text" name="parameter.agemin.101.0" value="21" />

					</td>
					<td>
						<input type="text" name="parameter.agemax.101.0" value="36" />

					</td>
					<td>
						<input type="text" name="parameter.skillmin.101.0" value="1" />

					</td>
					<td>
						<input type="text" name="parameter.skillmax.101.0" value="100" />

					</td>
					<td>
						<input type="text" name="parameter.maxskillmin.101.0" value="70" />

					</td>
				</tr>

				<tr>
					<td>
						101
					</td>
					<td>
						1
					</td>
					<td>
						<input type="text" name="parameter.skillpoints.101.1" value="1000" />

					</td>
					<td>
						<input type="text" name="parameter.agemin.101.1" value="21" />

					</td>
					<td>
						<input type="text" name="parameter.agemax.101.1" value="36" />

					</td>
					<td>

						<input type="text" name="parameter.skillmin.101.1" value="1" />

					</td>
					<td>
						<input type="text" name="parameter.skillmax.101.1" value="100" />

					</td>
					<td>
						<input type="text" name="parameter.maxskillmin.101.1" value="70" />

					</td>
				</tr>
				<tr>
					<td>
						101
					</td>
					<td>
						2
					</td>
					<td>

						<input type="text" name="parameter.skillpoints.101.2" value="1000" />

					</td>
					<td>
						<input type="text" name="parameter.agemin.101.2" value="21" />

					</td>
					<td>
						<input type="text" name="parameter.agemax.101.2" value="36" />

					</td>
					<td>
						<input type="text" name="parameter.skillmin.101.2" value="1" />

					</td>
					<td>
						<input type="text" name="parameter.skillmax.101.2" value="100" />

					</td>
					<td>

						<input type="text" name="parameter.maxskillmin.101.2" value="70" />

					</td>
				</tr>
				<tr>
					<td>
						101
					</td>
					<td>
						3
					</td>

					<td>
						<input type="text" name="parameter.skillpoints.101.3" value="1000" />

					</td>
					<td>
						<input type="text" name="parameter.agemin.101.3" value="21" />

					</td>
					<td>
						<input type="text" name="parameter.agemax.101.3" value="36" />

					</td>
					<td>
						<input type="text" name="parameter.skillmin.101.3" value="1" />

					</td>
					<td>
						<input type="text" name="parameter.skillmax.101.3" value="100" />

					</td>

					<td>
						<input type="text" name="parameter.maxskillmin.101.3" value="70" />

					</td>
				</tr>
				<tr>
					<td>
						102
					</td>
					<td>

						0
					</td>
					<td>
						<input type="text" name="parameter.skillpoints.102.0" value="1000" />

					</td>
					<td>
						<input type="text" name="parameter.agemin.102.0" value="21" />

					</td>

					<td>
						<input type="text" name="parameter.agemax.102.0" value="36" />

					</td>
					<td>
						<input type="text" name="parameter.skillmin.102.0" value="1" />

					</td>
					<td>
						<input type="text" name="parameter.skillmax.102.0" value="100" />

					</td>
					<td>
						<input type="text" name="parameter.maxskillmin.102.0" value="70" />

					</td>
				</tr>
				<tr>
					<td>
						102
					</td>

					<td>
						1
					</td>
					<td>
						<input type="text" name="parameter.skillpoints.102.1" value="1000" />

					</td>
					<td>
						<input type="text" name="parameter.agemin.102.1" value="21" />

					</td>
					<td>
						<input type="text" name="parameter.agemax.102.1" value="36" />

					</td>
					<td>
						<input type="text" name="parameter.skillmin.102.1" value="1" />

					</td>
					<td>

						<input type="text" name="parameter.skillmax.102.1" value="100" />

					</td>
					<td>
						<input type="text" name="parameter.maxskillmin.102.1" value="70" />

					</td>
				</tr>
				<tr>
					<td>

						102
					</td>
					<td>
						2
					</td>
					<td>
						<input type="text" name="parameter.skillpoints.102.2" value="1000" />

					</td>
					<td>

						<input type="text" name="parameter.agemin.102.2" value="21" />

					</td>
					<td>
						<input type="text" name="parameter.agemax.102.2" value="36" />

					</td>
					<td>
						<input type="text" name="parameter.skillmin.102.2" value="1" />

					</td>
					<td>
						<input type="text" name="parameter.skillmax.102.2" value="100" />

					</td>
					<td>
						<input type="text" name="parameter.maxskillmin.102.2" value="70" />

					</td>
				</tr>

				<tr>
					<td>
						102
					</td>
					<td>
						3
					</td>
					<td>
						<input type="text" name="parameter.skillpoints.102.3" value="1000" />

					</td>
					<td>
						<input type="text" name="parameter.agemin.102.3" value="21" />

					</td>
					<td>
						<input type="text" name="parameter.agemax.102.3" value="36" />

					</td>
					<td>

						<input type="text" name="parameter.skillmin.102.3" value="1" />

					</td>
					<td>
						<input type="text" name="parameter.skillmax.102.3" value="100" />

					</td>
					<td>
						<input type="text" name="parameter.maxskillmin.102.3" value="70" />

					</td>
				</tr>
				<tr>
					<td colspan="8">
						NOTE: pressing this button will save any changes to the above parameters,
						but no changes will be made to the game until you press the second button
						below
						<input type="submit" name="submit" value="changeparameters"/>
					</td>
				</tr>
				<tr>

					<td colspan="8">
						Note: this button will IGNORE any changes made to the above parameters
						<input type="submit" name="submit" value="initialisegame"/>
					</td>
				</tr>
			</table>
		</form>

		<center>
			<table width="60%" border="1">

				<tr><td><font size="2">Module:
<b>uk.co.summitsoccer.orders.GameInitialisationModule</b> -- Version:
<b>3</b></font></td></tr>
			</table>
		</center>
	</body>
</html>

Comment 1

15 years ago
Created attachment 129520 [details]
reporter's html page

Comment 2

15 years ago
worksforme with linux trunk 20030808 and 1.3.  used ethereal to capture packets.  
one of the packets said:
Content-Type: application/x-www-form-urlencoded

please try a newer build.  bugs reports from any builds before the latest
milestone (1.5a) aren't particularly useful as many have already been fixed.

also, please don't paste massive HTML into the bug report, just create an
attachment ("Create a New Attachment")
Marking worksforme per comment 2 and due to lack of response from reporter. 
Please reopen if this is still a problem with a current build.
Status: UNCONFIRMED → RESOLVED
Last Resolved: 15 years ago
Resolution: --- → WORKSFORME
You need to log in before you can comment on or make changes to this bug.