Skip to content

[SR-11673] [Linux] URLSession download task merges redirect responses #3379

Closed
@swift-ci

Description

@swift-ci
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.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions