Skip to content

Commit 5cc1795

Browse files
Add tests for #273.
1 parent 9fc4ebd commit 5cc1795

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

XCode/SwifterTestsCommon/SwifterTestsHttpParser.swift

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,9 @@ class SwifterTestsHttpParser: XCTestCase {
9999
r = try? parser.readHttpRequest(TestSocket("POST / HTTP/1.0\nContent-Length: 10\n\n1234567890"))
100100
XCTAssertEqual(r?.method, "POST", "Parser should extract HTTP method name from the status line.")
101101

102+
r = try? parser.readHttpRequest(TestSocket("GET / HTTP/1.0\nHeader1: 1:1:34\nHeader2: 12345\nContent-Length: 0\n\n"))
103+
XCTAssertEqual(r?.headers["header1"], "1:1:34", "Parser should properly extract header name and value in case the value has ':' character.")
104+
102105
r = try? parser.readHttpRequest(TestSocket("GET / HTTP/1.0\nHeader1: 1\nHeader2: 2\nContent-Length: 0\n\n"))
103106
XCTAssertEqual(r?.headers["header1"], "1", "Parser should extract multiple headers from the request.")
104107
XCTAssertEqual(r?.headers["header2"], "2", "Parser should extract multiple headers from the request.")

0 commit comments

Comments
 (0)