Skip to content

Commit 83c610e

Browse files
committed
Add crashing example test
1 parent 13245b4 commit 83c610e

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

Tests/Foundation/TestURLSession.swift

+12
Original file line numberDiff line numberDiff line change
@@ -283,6 +283,18 @@ final class TestURLSession: LoopbackServerTest, @unchecked Sendable {
283283
await downloadTaskWithRequestAndHandler(with: session)
284284
}
285285

286+
func downloadTaskWithTruncatedHeaders() async {
287+
let configuration = URLSessionConfiguration.default
288+
let session = URLSession(configuration: configuration)
289+
290+
// url1 works
291+
let url1 = URL(string: "https://github.com/IBM-Swift/CArchive/raw/master/module.modulemap")!
292+
//url2 generates a Fatal error
293+
let url2 = URL(string: "https://store-test.blobstore.apple.com/test2/think.txt?AWSAccessKeyId=MKIAQ46TEN6NTFP8PJAP&SignatureMethod=HmacSHA1&SignatureVersion=2&Expires=64092211200&Signature=jgHl7aTtiJhkvSaRC19YaH2T2qo%3D")!
294+
295+
let (data, response) = try await session.data(from: url2)
296+
}
297+
286298
func downloadTaskWithRequestAndHandler(with session: URLSession) async {
287299
let urlString = "http://127.0.0.1:\(TestURLSession.serverPort)/country.txt"
288300
let expect = expectation(description: "Download GET \(urlString): with a completion handler")

0 commit comments

Comments
 (0)