-
Notifications
You must be signed in to change notification settings - Fork 199
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
fix(analytics): update error handling #3261
Conversation
|
||
class AnalyticsErrorHelper { | ||
enum AnalyticsErrorHelper { |
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.
curious why this was changed from class to enum?
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.
I think I must've instinctively made that change without realizing it.
As a simple namespace, it should be an enum. That said, I don't mind reverting as it doesn't really belong in this PR.
request.headers = headers | ||
for header in headers.headers { | ||
for value in header.value { | ||
request.withHeader(name: header.name, value: value) |
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.
Looking at how this is implemented, it looks like we'll be adding all the original headers to the new additionalHeaders
list, which will then be combined with the original headers resulting in unnecessary duplication.
I believe we can just do this instead:
request.withHeader(
name: userAgentHeader,
value: "\(currentUserAgent)\(userAgentSuffix)"
)
But now I wonder, would we be sending two values for the User-Agent
header then? 🤔. Would that still work?
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.
Swift SDK Update 0.26.0
Makes necessary changes to get AWSPluginsCore to compile.
Debt Introduced
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.