Skip to content

Commit 3c3663b

Browse files
committed
update changelog & fix invalid test
* added `update` entries to CHANGELOG.md describing fixed parsing & new test * fix invalid test, don't need the full domain in parser * ran `swift test --generate-linuxmain`
1 parent e89aec1 commit 3c3663b

File tree

3 files changed

+4
-1
lines changed

3 files changed

+4
-1
lines changed

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,8 @@ All notable changes to this project will be documented in this file. Changes not
2525
## Changed
2626

2727
- Set the version of the HTTP Server based in the project version in the **Info.plist** for macOS, iOS and tvOS platforms. ([#416](https://github.com/httpswift/swifter/pull/416)) by [@Vkt0r](https://github.com/Vkt0r)
28+
- Update `HttpParser` so it percent-encodes the URL components before initializing `URLComponents`
29+
- Update `SwifterTestsHttpParser` with a test for parsing bracketed query strings
2830

2931
# [1.4.7]
3032

XCode/Tests/SwifterTestsHttpParser.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,7 @@ class SwifterTestsHttpParser: XCTestCase {
166166
XCTAssertEqual(resp?.headers["header1"], "1", "Parser should extract multiple headers from the request.")
167167
XCTAssertEqual(resp?.headers["header2"], "2", "Parser should extract multiple headers from the request.")
168168

169-
resp = try? parser.readHttpRequest(TestSocket("GET https://www.example.com/some/path?subscript_query[]=1&subscript_query[]=2 HTTP/1.0\nContent-Length: 10\n\n1234567890"))
169+
resp = try? parser.readHttpRequest(TestSocket("GET /some/path?subscript_query[]=1&subscript_query[]=2 HTTP/1.0\nContent-Length: 10\n\n1234567890"))
170170
let queryPairs = resp?.queryParams ?? []
171171
XCTAssertEqual(queryPairs.count, 2)
172172
XCTAssertEqual(queryPairs.first?.0, "subscript_query[]")

XCode/Tests/XCTestManifests.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,7 @@ extension SwifterTestsWebSocketSession {
9797

9898
public func __allTests() -> [XCTestCaseEntry] {
9999
return [
100+
testCase(IOSafetyTests.__allTests__IOSafetyTests),
100101
testCase(MimeTypeTests.__allTests__MimeTypeTests),
101102
testCase(ServerThreadingTests.__allTests__ServerThreadingTests),
102103
testCase(SwifterTestsHttpParser.__allTests__SwifterTestsHttpParser),

0 commit comments

Comments
 (0)