Skip to content

Commit 00fd5e3

Browse files
committed
rename VALUE_CHARS to HTTP_VALUE; flesh out code
1 parent cfb30ee commit 00fd5e3

File tree

3 files changed

+5
-2
lines changed

3 files changed

+5
-2
lines changed

make_encode_sets.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
('PASSWORD', r''' "#<>`?{}@\/'''),
3030
('USERNAME', r''' "#<>`?{}@\/:'''),
3131
('FORM_URLENCODED', r''' !"#$%&\'()+,/:;<=>?@[\]^`{|}~'''),
32-
('VALUE_CHARS', r''' "%'()*,/:;<->?[\]{}'''),
32+
('HTTP_VALUE', r''' "%'()*,/:;<->?[\]{}'''),
3333
]:
3434
print(
3535
"pub static %s: [&'static str; 256] = [\n%s\n];\n\n"

src/encode_sets.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -260,7 +260,7 @@ pub static FORM_URLENCODED: [&'static str; 256] = [
260260
];
261261

262262

263-
pub static VALUE_CHARS: [&'static str; 256] = [
263+
pub static HTTP_VALUE: [&'static str; 256] = [
264264
"%00", "%01", "%02", "%03", "%04", "%05", "%06", "%07",
265265
"%08", "%09", "%0A", "%0B", "%0C", "%0D", "%0E", "%0F",
266266
"%10", "%11", "%12", "%13", "%14", "%15", "%16", "%17",

src/percent_encoding.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,9 @@ pub static FORM_URLENCODED_ENCODE_SET: EncodeSet = EncodeSet {
5555
map: &encode_sets::FORM_URLENCODED,
5656
};
5757

58+
/// This encode set is used for HTTP header values and is defined at
59+
/// https://tools.ietf.org/html/rfc5987#section-3.2
60+
pub static HTTP_VALUE_ENCODE_SET: EncodeSet = EncodeSet { map: &encode_sets::HTTP_VALUE };
5861

5962
/// Percent-encode the given bytes, and push the result to `output`.
6063
///

0 commit comments

Comments
 (0)