Skip to content

Commit

Permalink
rename VALUE_CHARS to HTTP_VALUE; flesh out code
Browse files Browse the repository at this point in the history
  • Loading branch information
mikedilger committed Nov 12, 2015
1 parent cfb30ee commit 00fd5e3
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 2 deletions.
2 changes: 1 addition & 1 deletion make_encode_sets.py
Expand Up @@ -29,7 +29,7 @@
('PASSWORD', r''' "#<>`?{}@\/'''),
('USERNAME', r''' "#<>`?{}@\/:'''),
('FORM_URLENCODED', r''' !"#$%&\'()+,/:;<=>?@[\]^`{|}~'''),
('VALUE_CHARS', r''' "%'()*,/:;<->?[\]{}'''),
('HTTP_VALUE', r''' "%'()*,/:;<->?[\]{}'''),
]:
print(
"pub static %s: [&'static str; 256] = [\n%s\n];\n\n"
Expand Down
2 changes: 1 addition & 1 deletion src/encode_sets.rs
Expand Up @@ -260,7 +260,7 @@ pub static FORM_URLENCODED: [&'static str; 256] = [
];


pub static VALUE_CHARS: [&'static str; 256] = [
pub static HTTP_VALUE: [&'static str; 256] = [
"%00", "%01", "%02", "%03", "%04", "%05", "%06", "%07",
"%08", "%09", "%0A", "%0B", "%0C", "%0D", "%0E", "%0F",
"%10", "%11", "%12", "%13", "%14", "%15", "%16", "%17",
Expand Down
3 changes: 3 additions & 0 deletions src/percent_encoding.rs
Expand Up @@ -55,6 +55,9 @@ pub static FORM_URLENCODED_ENCODE_SET: EncodeSet = EncodeSet {
map: &encode_sets::FORM_URLENCODED,
};

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

/// Percent-encode the given bytes, and push the result to `output`.
///
Expand Down

0 comments on commit 00fd5e3

Please sign in to comment.