-
Notifications
You must be signed in to change notification settings - Fork 122
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
Add Request/Response History to all public Response
types
#817
Conversation
I think |
|
||
/// The target URL (after redirects) of the response. | ||
public var url: URL? { | ||
self.history.last?.request.url |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we think nil
is actually possible here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
as mentioned above, but copying here: Not from any HTTPClient.Response
vended by the library, but since there are already public initializers, it will be nil
for any library users that have been creating their own HTTPClient.Response
.
It seems like |
I'd expect that to just work. |
indeed it does! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice one, I think this looks great.
Looks like we need to guard the Foundation imports with |
Head branch was pushed to by a user without write access
I did it somewhat surgically - let me know if this works import Foundation
#if compiler(<6.0)
@preconcurrency import struct Foundation.URL
#endif |
@Lukasa, I "fixed" the API breakage... I think we should be good to go now |
Nevermind, I don't actually like that and changed it to #if compiler(>=6.0)
import Foundation
#else
@preconcurrency import Foundation
#endif |
@Lukasa, ready to go! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great, still happy here, thanks!
Looks like the format check has opinions again, I'm afraid. |
Format check is still grouchy. |
and fixed |
Work to close #790
The fact that
HTTPClient.Request
is not Sendable make me think we're going to need to store something else, such as aURL
andHTTPRequestHead
, instead?