-
Notifications
You must be signed in to change notification settings - Fork 31
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
feat: update http requests, responses and endpoint with URI #719
Conversation
f176753
to
1b21b73
Compare
c411694
to
e0b8ca0
Compare
Sources/ClientRuntime/Networking/Http/Middlewares/ContentTypeMiddleware.swift
Outdated
Show resolved
Hide resolved
Sources/ClientRuntime/Networking/Http/Middlewares/FlexibleChecksumsRequestMiddleware.swift
Outdated
Show resolved
Hide resolved
return URI(scheme: self.scheme, | ||
path: self.path, | ||
host: self.host, | ||
port: self.port, | ||
query: self.query, | ||
username: self.username, | ||
password: self.password) |
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.
If my understanding is correct, URIBuilder
is using URLComponents
to throw errors when an invalid value is passed. But URLComponents
also percent-encodes stuff when necessary - like if you did urlComponents.query = "#"
, it'll encode the query to be "%23"
. I think you could just use URLComponents
instead of storing the other members.
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.
Removed members except path
(See above comment) and port
. Port is kept because I am not assigning it to URLComponents, otherwise the port number will appear in the url string which is not what we want.
5a58fc9
to
d329cb8
Compare
if self.path.contains("%") { | ||
self.urlComponents.percentEncodedPath = self.path | ||
} else { | ||
self.urlComponents.path = self.path | ||
} |
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.
A consequence of this though is that callers of URI.path
now can't know whether the URI
is percent encoded or not. I guess they use the String extension you added though. But if they wanted it to be encoded and it's not, they have to do it themselves?
6809785
to
7f07a09
Compare
In aws-sdk-swift, the pre-signed reques url becomes invalid if we auto-populate the default port A |
d3baa32
to
8553684
Compare
Tests/ClientRuntimeTests/NetworkingTests/Http/CRTClientEngineIntegrationTests.swift
Outdated
Show resolved
Hide resolved
Tests/ClientRuntimeTests/OrchestratorTests/OrchestratorTests.swift
Outdated
Show resolved
Hide resolved
8553684
to
04b2848
Compare
b84f52f
to
d61a21b
Compare
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.
Comments on addressing swiftlint warning & a compiler warning
d61a21b
to
e7a41c4
Compare
…tion` to `RequestMessage`
e7a41c4
to
7dfc184
Compare
Addressed all of Miles's comments
Description of changes
Update http requests, responses and endpoint with uri to align with Smithy SRA design
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.