-
Notifications
You must be signed in to change notification settings - Fork 295
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
HTTPClient
: test all request headers
#3425
Conversation
700fc54
to
50ad627
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.
❤️ We should add backend request snapshot tests working on Android soon
] | ||
|
||
if let storefront = self.systemInfo.storefront { | ||
headers["X-Storefront"] = storefront.countryCode |
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.
FFTI but in android we add all the headers to the same map and then filter out null values. That might be slightly more legible?
@@ -119,6 +155,8 @@ extension HTTPClient { | |||
case eTag = "X-RevenueCat-ETag" | |||
case eTagValidationTime = "X-RC-Last-Refresh-Time" | |||
case postParameters = "X-Post-Params-Hash" | |||
case headerParametersForSignature = "X-Header-Params-Hash" |
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.
Hmm this enum seems unused?
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.
Oops thanks that's for #3424.
…#3430) Requested by @NachoSoto for [http-client-test-headers](https://github.com/RevenueCat/purchases-ios/tree/http-client-test-headers) Co-authored-by: distiller <distiller@static.38.23.42.70.cyberlynk.net>
…#3429) Requested by @NachoSoto for [http-client-test-headers](https://github.com/RevenueCat/purchases-ios/tree/http-client-test-headers) Co-authored-by: Distiller <distiller@static.38.23.39.118.cyberlynk.net>
…#3427) Requested by @NachoSoto for [http-client-test-headers](https://github.com/RevenueCat/purchases-ios/tree/http-client-test-headers) Co-authored-by: Distiller <distiller@static.38.39.183.102.cyberlynk.net>
…#3426) Requested by @NachoSoto for [http-client-test-headers](https://github.com/RevenueCat/purchases-ios/tree/http-client-test-headers) Co-authored-by: Distiller <distiller@static.38.39.184.190.cyberlynk.net>
…#3428) Requested by @NachoSoto for [http-client-test-headers](https://github.com/RevenueCat/purchases-ios/tree/http-client-test-headers) Co-authored-by: Distiller <distiller@static.38.39.183.59.cyberlynk.net>
…#3432) Requested by @NachoSoto for [http-client-test-headers](https://github.com/RevenueCat/purchases-ios/tree/http-client-test-headers) Co-authored-by: Distiller <distiller@static.38.39.183.78.cyberlynk.net>
26c660b
to
5d0afcb
Compare
…#3447) Requested by @NachoSoto for [http-client-test-headers](https://github.com/RevenueCat/purchases-ios/tree/http-client-test-headers) Co-authored-by: Distiller <distiller@static.38.39.185.38.cyberlynk.net>
…#3446) Requested by @NachoSoto for [http-client-test-headers](https://github.com/RevenueCat/purchases-ios/tree/http-client-test-headers) Co-authored-by: Distiller <distiller@static.38.23.39.42.cyberlynk.net>
…#3448) Requested by @NachoSoto for [http-client-test-headers](https://github.com/RevenueCat/purchases-ios/tree/http-client-test-headers) Co-authored-by: distiller <distiller@distillers-Virtual-Machine.local>
…#3449) Requested by @NachoSoto for [http-client-test-headers](https://github.com/RevenueCat/purchases-ios/tree/http-client-test-headers) Co-authored-by: Distiller <distiller@static.38.23.40.176.cyberlynk.net>
…#3454) Requested by @NachoSoto for [http-client-test-headers](https://github.com/RevenueCat/purchases-ios/tree/http-client-test-headers) Co-authored-by: Distiller <distiller@static.198.206.135.18.macminivault.com>
…#3455) Requested by @NachoSoto for [http-client-test-headers](https://github.com/RevenueCat/purchases-ios/tree/http-client-test-headers) Co-authored-by: distiller <distiller@distillers-Virtual-Machine.local>
…#3453) Requested by @NachoSoto for [http-client-test-headers](https://github.com/RevenueCat/purchases-ios/tree/http-client-test-headers) Co-authored-by: Distiller <distiller@static.198.206.135.45.macminivault.com>
…#3452) Requested by @NachoSoto for [http-client-test-headers](https://github.com/RevenueCat/purchases-ios/tree/http-client-test-headers) Co-authored-by: Distiller <distiller@static.38.23.39.121.cyberlynk.net>
…#3451) Requested by @NachoSoto for [http-client-test-headers](https://github.com/RevenueCat/purchases-ios/tree/http-client-test-headers) Co-authored-by: Distiller <distiller@static.38.39.184.186.cyberlynk.net>
**This is an automatic release.** ### RevenueCatUI * Paywalls: Fix navigation with close button in UIKit (#3466) via Andy Boedo (@aboedo) * `Paywalls`: `watchOS` support (#3291) via NachoSoto (@NachoSoto) ### Dependency Updates * Bump cocoapods from 1.14.2 to 1.14.3 (#3464) via dependabot[bot] (@dependabot[bot]) * Bump fastlane from 2.216.0 to 2.217.0 (#3415) via dependabot[bot] (@dependabot[bot]) * Bump danger from 9.3.2 to 9.4.0 (#3414) via dependabot[bot] (@dependabot[bot]) ### Other Changes * Some `APITester` fixes (#3444) via NachoSoto (@NachoSoto) * `HTTPClient`: test all request headers (#3425) via NachoSoto (@NachoSoto) * `CircleCI`: fix snapshot generation for iOS 14 (#3431) via NachoSoto (@NachoSoto) * Remove `MockStoreMessagesHelper` from SDK (#3417) via NachoSoto (@NachoSoto) * Enable explicit_init lint rule and fix issues (#3418) via Mark Villacampa (@MarkVillacampa)
This allows us to verify exactly what headers are included in all requests.
It also simplifies the implementation for #3424.