From 18dcc3ccad482e4d82ff51c11562dfcb8c085213 Mon Sep 17 00:00:00 2001
From: Andreu Botella Let pairs be the result of converting to a list of name-value pairs with entry list. Let query be the result of running the
-
application/x-www-form-urlencoded
serializer with entry
- list and encoding.application/x-www-form-urlencoded
serializer with pairs
+ and encoding.
Set parsed action's query component to query.
@@ -56087,9 +56090,12 @@ furapplication/x-www-form-urlencoded
Let pairs be the result of converting to a list of name-value pairs with entry list.
+Let body be the result of running the
- application/x-www-form-urlencoded
serializer with entry
- list and encoding.
application/x-www-form-urlencoded
serializer with pairs
+ and encoding.
Set body to the result of encoding body.
@@ -56100,6 +56106,24 @@ furmultipart/form-data
For each entry in entry list:
+ +Replace every occurrence of U+000D (CR) not followed by U+000A (LF), and every + occurrence of U+000A (LF) not preceded by U+000D (CR), in the entry's name, by a string + consisting of a U+000D (CR) and U+000A (LF).
If the entry's value is not a File
object, replace every occurrence of
+ U+000D (CR) not followed by U+000A (LF), and every occurrence of U+000A (LF) not preceded
+ by U+000D (CR), in the entry's value, by a string consisting of a U+000D (CR) and U+000A
+ (LF).
These newline conversions in this algorithm are necessary because not all + names and string values in entry lists reaching this point need have been previously + normalized when appending the entry. That + normalization is idempotent, so implementations are allowed to keep track of which names and + values have been previously normalized in order to skip them in this algorithm.
+Let body be the result of running the multipart/form-data
encoding algorithm with entry list
and encoding.
text/plain
Let pairs be the result of converting to a list of name-value pairs with entry list.
+Let body be the result of running the text/plain
- encoding algorithm with entry list.
Set body to the result of encoding body using encoding.
@@ -56141,9 +56168,12 @@ furLet pairs be the result of converting to a list of name-value pairs with entry list.
+Let headers be the result of running the
- application/x-www-form-urlencoded
serializer with entry
- list and encoding.
application/x-www-form-urlencoded
serializer with pairs
+ and encoding.
Replace occurrences of U+002B PLUS SIGN characters (+) in headers with
the string "%20
".
Let pairs be the result of converting to a list of name-value pairs with entry list.
+Switch on enctype:
Let body be the result of running the text/plain
- encoding algorithm with entry list.
Set body to the result of running UTF-8 percent-encode on body using the default encode set.
@@ -56172,8 +56205,8 @@ furLet body be the result of running the
- application/x-www-form-urlencoded
serializer with entry
- list and encoding.
application/x-www-form-urlencoded
serializer with pairs
+ and encoding.If parsed action's query is null, then @@ -56514,6 +56547,53 @@ fur +
The application/x-www-form-urlencoded
and text/plain
encoding algorithms take a list of name-value pairs, where the values
+ must be strings, rather than an entry list where the value can be a File
. The
+ following algorithm performs the conversion.
To convert to a list of name-value pairs an entry list entry list, run + these steps:
+ +Let list be an empty list of name-value pairs.
For each entry in entry list:
+ +Let name be the entry's name, with every occurrence of U+000D (CR) not + followed by U+000A (LF), and every occurrence of U+000A (LF) not preceded by U+000D (CR), + replaced by a string consisting of U+000D (CR) and U+000A (LF).
If the entry's value is a File
, then let value be the entry's
+ value's name
. Otherwise, let value be the
+ entry's value, with every occurrence of U+000D (CR) not followed by U+000A (LF), and every
+ occurrence of U+000A (LF) not preceded by U+000D (CR), replaced by a string consisting of
+ U+000D (CR) and U+000A (LF).
Append to list a new name-value pair whose + name is name and whose value is value.
Return list.
The newline conversions in this algorithm are necessary because not all names and
+ string values reaching the application/x-www-form-urlencoded
or text/plain
serializers need have been previously
+ normalized when appending the entry, and in fact no
+ filenames have. That normalization is idempotent, so implementations are allowed to keep track of
+ which names and string values have been previously normalized in order to skip them in this
+ algorithm.
The text/plain
encoding algorithm, given an entry
- list, is as follows:
The text/plain
encoding algorithm, given a list of name-value
+ pairs pairs, is as follows:
Let result be the empty string.
For each entry in entry list:
+For each pair in pairs:
If the entry's value is a File
object, then set its value to the
- File
object's name
.
Append the entry's name to result.
Append pair's name to result.
Append a single U+003D EQUALS SIGN character (=) to result.
Append the entry's value to result.
Append pair's value to result.
Append a U+000D CARRIAGE RETURN (CR) U+000A LINE FEED (LF) character pair to result.
multipart/form-data
For each entry in entry list:
- -Replace every occurrence of U+000D (CR) not followed by U+000A (LF), and every - occurrence of U+000A (LF) not preceded by U+000D (CR), in the entry's name, by a string - consisting of a U+000D (CR) and U+000A (LF).
If the entry's value is not a File
object, replace every occurrence of
- U+000D (CR) not followed by U+000A (LF), and every occurrence of U+000A (LF) not preceded
- by U+000D (CR), in the entry's value, by a string consisting of a U+000D (CR) and U+000A
- (LF).
These newline conversions in this algorithm are necessary because not all - names and string values in entry lists reaching this point need have been previously - normalized when appending the entry. That - normalization is idempotent, so implementations are allowed to keep track of which names and - values have been previously normalized in order to skip them in this algorithm.
-Let body be the result of running the multipart/form-data
encoding algorithm with entry list
and encoding.
For each entry in entry list:
+ +Replace every occurrence of U+000D (CR) not followed by U+000A (LF), and every + occurrence of U+000A (LF) not preceded by U+000D (CR), in the entry's name, by a string + consisting of a U+000D (CR) and U+000A (LF).
If the entry's value is not a File
object, replace every occurrence of
+ U+000D (CR) not followed by U+000A (LF), and every occurrence of U+000A (LF) not preceded
+ by U+000D (CR), in the entry's value, by a string consisting of a U+000D (CR) and U+000A
+ (LF).
These newline conversions in this algorithm are necessary because not all + names and string values in entry lists reaching this point need have been previously + normalized when appending the entry. That + normalization is idempotent, so implementations are allowed to keep track of which names and + values have been previously normalized in order to skip them in this algorithm.
+Return the byte sequence resulting from encoding the entry list using the rules
described by RFC 7578, Returning Values from Forms: Return list.
Date: Mon, 18 Jan 2021 13:21:45 +0100
Subject: [PATCH 3/6] Reword the notes about double normalization.
---
source | 22 +++++++++++-----------
1 file changed, 11 insertions(+), 11 deletions(-)
diff --git a/source b/source
index 083ba50eaec..19c97b69ea2 100644
--- a/source
+++ b/source
@@ -56549,12 +56549,12 @@ fur
The newline conversions in this algorithm are necessary because not all names and
- string values reaching the application/x-www-form-urlencoded
or text/plain
serializers need have been previously
- normalized when appending the entry, and in fact no
- filenames have. That normalization is idempotent, so implementations are allowed to keep track of
- which names and string values have been previously normalized in order to skip them in this
+
The newline conversions in this algorithm are necessary because some of the names
+ and string values reaching the application/x-www-form-urlencoded
or text/plain
serializers might not have been
+ previously normalized in the appending the entry algorithm,
+ and in fact no filenames have. That normalization is idempotent, so implementations are allowed to
+ keep track of which entries have been previously normalized in order to skip them in this
algorithm.
These newline conversions in this algorithm are necessary because not all - names and string values in entry lists reaching this point need have been previously - normalized when appending the entry. That - normalization is idempotent, so implementations are allowed to keep track of which names and - values have been previously normalized in order to skip them in this algorithm.
+These newline conversions in this algorithm are necessary because some of the + names and string values in entry lists reaching this encoding algorithm might not have been + previously normalized in the appending the entry + algorithm. That normalization is idempotent, so implementations are allowed to keep track of + which entries have been previously normalized in order to skip them in this algorithm.
Let list be an empty list of name-value pairs.
For each entry in entry list:
+For each entry of entry list:
Let name be the entry's name, with every occurrence of U+000D (CR) not +
Let name be entry's name, with every occurrence of U+000D (CR) not followed by U+000A (LF), and every occurrence of U+000A (LF) not preceded by U+000D (CR), replaced by a string consisting of U+000D (CR) and U+000A (LF).
If the entry's value is a File
, then let value be the entry's
- value's name
. Otherwise, let value be the
- entry's value, with every occurrence of U+000D (CR) not followed by U+000A (LF), and every
- occurrence of U+000A (LF) not preceded by U+000D (CR), replaced by a string consisting of
- U+000D (CR) and U+000A (LF).
If entry's value is a File
object, then let value be
+ entry's value's name
. Otherwise, let
+ value be entry's value, with every occurrence of U+000D (CR) not followed
+ by U+000A (LF), and every occurrence of U+000A (LF) not preceded by U+000D (CR), replaced by a
+ string consisting of U+000D (CR) and U+000A (LF).
Append to list a new name-value pair whose name is name and whose value is value.
For each entry in entry list:
+For each entry of entry list:
Replace every occurrence of U+000D (CR) not followed by U+000A (LF), and every - occurrence of U+000A (LF) not preceded by U+000D (CR), in the entry's name, by a string + occurrence of U+000A (LF) not preceded by U+000D (CR), in entry's name, by a string consisting of a U+000D (CR) and U+000A (LF).
If the entry's value is not a File
object, replace every occurrence of
- U+000D (CR) not followed by U+000A (LF), and every occurrence of U+000A (LF) not preceded
- by U+000D (CR), in the entry's value, by a string consisting of a U+000D (CR) and U+000A
- (LF).
If entry's value is not a File
object, then replace every
+ occurrence of U+000D (CR) not followed by U+000A (LF), and every occurrence of U+000A (LF) not
+ preceded by U+000D (CR), in entry's value, by a string consisting of a U+000D (CR)
+ and U+000A (LF).
These newline conversions in this algorithm are necessary because some of the
From b96d053957e97957e504d04eeb40719863799710 Mon Sep 17 00:00:00 2001
From: Andreu Botella Return list.
The newline conversions in this algorithm are necessary because some of the names
- and string values reaching the application/x-www-form-urlencoded
or text/plain
serializers might not have been
- previously normalized in the appending the entry algorithm,
- and in fact no filenames have. That normalization is idempotent, so implementations are allowed to
- keep track of which entries have been previously normalized in order to skip them in this
- algorithm.
These newline conversions in this algorithm are necessary because some of the - names and string values in entry lists reaching this encoding algorithm might not have been - previously normalized in the appending the entry - algorithm. That normalization is idempotent, so implementations are allowed to keep track of - which entries have been previously normalized in order to skip them in this algorithm.
If entry's value is a File
object, then let value be
entry's value's name
. Otherwise, let
- value be entry's value, with every occurrence of U+000D (CR) not followed
- by U+000A (LF), and every occurrence of U+000A (LF) not preceded by U+000D (CR), replaced by a
- string consisting of U+000D (CR) and U+000A (LF).
Replace every occurrence of U+000D (CR) not followed by U+000A (LF), and every occurrence + of U+000A (LF) not preceded by U+000D (CR), in value, by a string consisting of + U+000D (CR) and U+000A (LF).
Append to list a new name-value pair whose name is name and whose value is value.