You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Here requestHeaders are potentially new headers set after the access token was refreshed and headers are old headers.
Problems comes when both variables contain the same key and different value. When merging with a + operator in swift - it takes the last elements values.
So after token refresh if there was a new access token header set on requestHeaders and headers contained old value,
in the end the final headers would contain the old value.
Description:
OAuthSwiftHTTPRequest.swift line 423:
self.urlRequest.allHTTPHeaderFields = requestHeaders + headers
Here
requestHeaders
are potentially new headers set after the access token was refreshed andheaders
are old headers.Problems comes when both variables contain the same key and different value. When merging with a + operator in swift - it takes the last elements values.
So after token refresh if there was a new access token header set on
requestHeaders
andheaders
contained old value,in the end the final headers would contain the old value.
THE FIX:
Reverse the order or variables being merged like:
self.urlRequest.allHTTPHeaderFields = headers + requestHeaders
OAuth Provider? (Twitter, Github, ..):
OAuth Version:
OS (Please fill the version) :
Installation method:
Library version:
Xcode version:
11.4 (Swift 5.2)
11.x (Swift 5.1)
10.x (Swift 5.0)
other: (Please fill in the version you are using.)
objective c
swift
The text was updated successfully, but these errors were encountered: