Skip to content

Commit 118943f

Browse files
huonwalexcrichton
authored andcommitted
---
yaml --- r: 152335 b: refs/heads/try2 c: 1f4d8f9 h: refs/heads/master i: 152333: 214f8eb 152331: d9bf9f7 152327: 77e442a 152319: 3ded02a v: v3
1 parent ccd0965 commit 118943f

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ refs/heads/snap-stage3: 78a7676898d9f80ab540c6df5d4c9ce35bb50463
55
refs/heads/try: 519addf6277dbafccbb4159db4b710c37eaa2ec5
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b
8-
refs/heads/try2: b662aa5ec0eb1971111bf10f9c3ef2a8f226bb0a
8+
refs/heads/try2: 1f4d8f924e78408bc4b10a29da9c42ce29bd725c
99
refs/heads/dist-snap: ba4081a5a8573875fed17545846f6f6902c8ba8d
1010
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596
1111
refs/tags/release-0.3: b5f0d0f648d9a6153664837026ba1be43d3e2503

branches/try2/src/liburl/lib.rs

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -161,10 +161,10 @@ fn encode_inner(s: &str, full_url: bool) -> String {
161161
out.push_char(ch);
162162
}
163163

164-
_ => out.push_str(format!("%{:X}", ch as uint).as_slice())
164+
_ => out.push_str(format!("%{:02X}", ch as uint).as_slice())
165165
}
166166
} else {
167-
out.push_str(format!("%{:X}", ch as uint).as_slice());
167+
out.push_str(format!("%{:02X}", ch as uint).as_slice());
168168
}
169169
}
170170
}
@@ -1178,6 +1178,8 @@ mod tests {
11781178
assert_eq!(encode("@"), "@".to_string());
11791179
assert_eq!(encode("["), "[".to_string());
11801180
assert_eq!(encode("]"), "]".to_string());
1181+
assert_eq!(encode("\0"), "%00".to_string());
1182+
assert_eq!(encode("\n"), "%0A".to_string());
11811183
}
11821184

11831185
#[test]
@@ -1207,6 +1209,8 @@ mod tests {
12071209
assert_eq!(encode_component("@"), "%40".to_string());
12081210
assert_eq!(encode_component("["), "%5B".to_string());
12091211
assert_eq!(encode_component("]"), "%5D".to_string());
1212+
assert_eq!(encode_component("\0"), "%00".to_string());
1213+
assert_eq!(encode_component("\n"), "%0A".to_string());
12101214
}
12111215

12121216
#[test]

0 commit comments

Comments
 (0)