Skip to content

Commit e159524

Browse files
nethraravindranianpartridge
authored andcommitted
Fix for http redirect failure (#1577)
1 parent e58e92d commit e159524

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

Foundation/URLSession/http/HTTPURLProtocol.swift

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -401,10 +401,12 @@ internal extension _HTTPURLProtocol {
401401

402402
let scheme = request.url?.scheme
403403
let host = request.url?.host
404+
let port = request.url?.port
404405

405406
var components = URLComponents()
406407
components.scheme = scheme
407408
components.host = host
409+
components.port = port
408410
//The path must either begin with "/" or be an empty string.
409411
if targetURL.relativeString.first != "/" {
410412
components.path = "/" + targetURL.relativeString

0 commit comments

Comments
 (0)