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-11673] [Linux] URLSession download task merges redirect responses #3379

Closed
swift-ci opened this issue Oct 27, 2019 · 2 comments
Closed

Comments

@swift-ci
Copy link
Contributor

Previous ID SR-11673
Radar None
Original Reporter shad0wdev (JIRA User)
Type Bug
Status Resolved
Resolution Done

Attachment: Download

Environment

Ubuntu 18.04, 16.04

macOS Mojave

Swift 5.0 - 5.1 and master branch

Additional Detail from JIRA
Votes 0
Component/s Foundation
Labels Bug, Linux
Assignee @spevans
Priority Medium

md5: 62ca5b243957439bdbba7fbc7011d979

Issue Description:

Issue:

When trying to download file with URLSession, it merges HTML from redirect page (with all redirect codes - 301, 302, 307, 308) with data received from correct page (with code 200). This happens only on Linux platftorms and not on macOS.

How to reproduce:

  1. Be on Linux

  2. Use URL with any redirect code leading to any page with proper content you want to receive

  3. Use any URLSession with any configuration

  4. Use URLSession dataTask() method

I've written simple tests with simple Data(contentsOf: ) method, URLSession dataTask and downloadTask. They're in attachments.

@spevans
Copy link
Collaborator

spevans commented Mar 25, 2020

#2744

@spevans
Copy link
Collaborator

spevans commented Mar 27, 2020

Fixed in swift-DEVELOPMENT-SNAPSHOT-2020-03-26

$ ~/swift-build/swift-DEVELOPMENT-SNAPSHOT-2020-03-26-a-ubuntu18.04/usr/bin/swift sr-11673.swift 
 Test 1 passed!
 Test 2 passed!
 Test 3 passed!
 Test 4 passed!
 Hooray! There was no asserts!

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

No branches or pull requests

2 participants