| author | |
| committer | |
| log | 81713f20a6635c6905e81daa0a061e43c85db277 |
| tree | cd4e31b6ecce6f8f5f6bace240c73d02182f82e7 |
| parent | 69bcdbefd0128c14a4ebb7f1a4cfb784f826b85b |
| signature |
3 files changed, 6 insertions(+), 6 deletions(-)
lib/std/http/Client.zig+2-2| ... | @@ -489,9 +489,9 @@ pub const Response = struct { | ... | @@ -489,9 +489,9 @@ pub const Response = struct { |
| 489 | else => {}, | 489 | else => {}, |
| 490 | } | 490 | } |
| 491 | 491 | ||
| 492 | var line_it = mem.splitSequence(u8, line, ": "); | 492 | var line_it = mem.splitScalar(u8, line, ':'); |
| 493 | const header_name = line_it.next().?; | 493 | const header_name = line_it.next().?; |
| 494 | const header_value = line_it.rest(); | 494 | const header_value = mem.trim(u8, line_it.rest(), " \t"); |
| 495 | if (header_name.len == 0) return error.HttpHeadersInvalid; | 495 | if (header_name.len == 0) return error.HttpHeadersInvalid; |
| 496 | 496 | ||
| 497 | if (std.ascii.eqlIgnoreCase(header_name, "connection")) { | 497 | if (std.ascii.eqlIgnoreCase(header_name, "connection")) { |
lib/std/http/HeaderIterator.zig+2-2| ... | @@ -48,7 +48,7 @@ pub fn next(it: *HeaderIterator) ?std.http.Header { | ... | @@ -48,7 +48,7 @@ pub fn next(it: *HeaderIterator) ?std.http.Header { |
| 48 | } | 48 | } |
| 49 | 49 | ||
| 50 | test next { | 50 | test next { |
| 51 | var it = HeaderIterator.init("200 OK\r\na: b\r\nc: \r\nd: e\r\n\r\nf: g\r\n\r\n"); | 51 | var it = HeaderIterator.init("200 OK\r\na: b\r\nc: \r\nd:e\r\n\r\nf: g\r\n\r\n"); |
| 52 | try std.testing.expect(!it.is_trailer); | 52 | try std.testing.expect(!it.is_trailer); |
| 53 | { | 53 | { |
| 54 | const header = it.next().?; | 54 | const header = it.next().?; |
| ... | @@ -80,7 +80,7 @@ test next { | ... | @@ -80,7 +80,7 @@ test next { |
| 80 | try std.testing.expect(!it.is_trailer); | 80 | try std.testing.expect(!it.is_trailer); |
| 81 | try std.testing.expectEqual(null, it.next()); | 81 | try std.testing.expectEqual(null, it.next()); |
| 82 | 82 | ||
| 83 | it = HeaderIterator.init("200 OK\r\na: b\r\n\r\n: ss\r\n\r\n"); | 83 | it = HeaderIterator.init("200 OK\r\na:b\r\n\r\n: ss\r\n\r\n"); |
| 84 | try std.testing.expect(!it.is_trailer); | 84 | try std.testing.expect(!it.is_trailer); |
| 85 | { | 85 | { |
| 86 | const header = it.next().?; | 86 | const header = it.next().?; |
lib/std/http/Server.zig+2-2| ... | @@ -211,9 +211,9 @@ pub const Request = struct { | ... | @@ -211,9 +211,9 @@ pub const Request = struct { |
| 211 | else => {}, | 211 | else => {}, |
| 212 | } | 212 | } |
| 213 | 213 | ||
| 214 | var line_it = mem.splitSequence(u8, line, ": "); | 214 | var line_it = mem.splitScalar(u8, line, ':'); |
| 215 | const header_name = line_it.next().?; | 215 | const header_name = line_it.next().?; |
| 216 | const header_value = line_it.rest(); | 216 | const header_value = mem.trim(u8, line_it.rest(), " \t"); |
| 217 | if (header_name.len == 0) return error.HttpHeadersInvalid; | 217 | if (header_name.len == 0) return error.HttpHeadersInvalid; |
| 218 | 218 | ||
| 219 | if (std.ascii.eqlIgnoreCase(header_name, "connection")) { | 219 | if (std.ascii.eqlIgnoreCase(header_name, "connection")) { |