Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[SR-6406] Fatal error: Transfer completed, but there's no response.: file Foundation/URLSession/http/HTTPURLProtocol.swift, line 549 #4052

Open
swift-ci opened this issue Nov 16, 2017 · 1 comment · May be fixed by #5167

Comments

@swift-ci
Copy link
Contributor

Previous ID SR-6406
Radar None
Original Reporter p_thompson (JIRA User)
Type Bug
Environment

Swift 4.0.2-Release on Ubuntu 16.04.3

Additional Detail from JIRA
Votes 0
Component/s Foundation
Labels Bug, RunTimeCrash
Assignee None
Priority Medium

md5: bf90ed399248174c721a712a653ca69f

Issue Description:

When I open this url in a web browser, I get back a 6 byte text file with the contents "THINK\n". When I download it with a dataTask (or downloadTask), Swift gives me a fatal error instead.

Here is some code to reproduce the issue:

import Foundation

let configuration = URLSessionConfiguration.default
let session = URLSession(configuration: configuration)

// url1 works
let url1 = URL(string: "https://github.com/IBM-Swift/CArchive/raw/master/module.modulemap")!
//url2 generates a Fatal error
let url2 = URL(string: "https://store-test.blobstore.apple.com/test2/think.txt?AWSAccessKeyId=MKIAQ46TEN6NTFP8PJAP&SignatureMethod=HmacSHA1&SignatureVersion=2&Expires=64092211200&Signature=jgHl7aTtiJhkvSaRC19YaH2T2qo%3D")!

let dl_task = session.dataTask(with: url2) { (data, resp, err) in
    print(String(data: data ?? Data(), encoding: .utf8) ?? "")
}
dl_task.resume()

RunLoop.main.run()
@swift-ci
Copy link
Contributor Author

swift-ci commented Dec 1, 2017

Comment by Paul Thompson (JIRA)

This file comes with trailing headers, which might be the differentiator from other files.

@swift-ci swift-ci transferred this issue from apple/swift-issues Apr 25, 2022
@shahmishal shahmishal transferred this issue from swiftlang/swift May 5, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant