Skip to content
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(api): Add User-Agent and intercept subscription connect request #2680

Closed
wants to merge 1 commit into from

Conversation

lawmicha
Copy link
Contributor

Issue #

Description

Add User-Agent to the underlying URLRequest for subscriptions. This change depends on AppSyncRTClient 3.0.0 with aws-amplify/aws-appsync-realtime-client-ios#110

This change is in v2 and will need another PR for v1. AppSync SDK should also eventually consume AppSyncRTClient 3.0.0.

General Checklist

  • Added new tests to cover change, if needed
  • Build succeeds with all target using Swift Package Manager
  • All unit tests pass
  • All integration tests pass
  • Security oriented best practices and standards are followed (e.g. using input sanitization, principle of least privilege, etc)
  • Documentation update for the change if required
  • PR title conforms to conventional commit style
  • New or updated tests include Given When Then inline code documentation and are named accordingly testThing_condition_expectation()
  • If breaking change, documentation/changelog update with migration instructions

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

Comment on lines +94 to +108
urlRequest.setValue(AWSAPIPluginsCore.baseUserAgent(),
forHTTPHeaderField: URLRequestConstants.Header.userAgent)

// Intercept the request
for interceptor in requestInterceptors {
do {
urlRequest = try await interceptor.intercept(urlRequest)
} catch let error as APIError {
fail(error)
return
} catch {
fail(APIError.unknown("Could not validate request", "", nil))
return
}
}
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

^

@lawmicha
Copy link
Contributor Author

This PR is no longer required, see #2683 for latest

@lawmicha lawmicha closed this Jan 25, 2023
@lawmicha lawmicha deleted the fix.api-subscriptions branch January 26, 2023 17:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant