Skip to content

HTTPClient: test all request headers#3425

Merged
NachoSoto merged 23 commits into
mainfrom
http-client-test-headers
Nov 17, 2023
Merged

HTTPClient: test all request headers#3425
NachoSoto merged 23 commits into
mainfrom
http-client-test-headers

Conversation

@NachoSoto

@NachoSoto NachoSoto commented Nov 16, 2023

Copy link
Copy Markdown
Contributor

This allows us to verify exactly what headers are included in all requests.

It also simplifies the implementation for #3424.

@NachoSoto NachoSoto added the test label Nov 16, 2023
@NachoSoto NachoSoto requested a review from a team November 16, 2023 20:14
@NachoSoto NachoSoto force-pushed the http-client-test-headers branch 2 times, most recently from 700fc54 to 50ad627 Compare November 16, 2023 23:07
@NachoSoto NachoSoto changed the base branch from main to generate-snapshots-ios-14 November 16, 2023 23:21

@tonidero tonidero left a comment

Copy link
Copy Markdown
Contributor

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

Copy link
Copy Markdown
Contributor

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?

case eTag = "X-RevenueCat-ETag"
case eTagValidationTime = "X-RC-Last-Refresh-Time"
case postParameters = "X-Post-Params-Hash"
case headerParametersForSignature = "X-Header-Params-Hash"

Copy link
Copy Markdown
Contributor

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?

Copy link
Copy Markdown
Contributor Author

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.

Base automatically changed from generate-snapshots-ios-14 to main November 17, 2023 15:37
NachoSoto and others added 9 commits November 17, 2023 10:20
…#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>
@NachoSoto NachoSoto force-pushed the http-client-test-headers branch from 26c660b to 5d0afcb Compare November 17, 2023 18:43
NachoSoto and others added 12 commits November 17, 2023 11:01
…#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>
@NachoSoto NachoSoto enabled auto-merge (squash) November 17, 2023 19:40
@NachoSoto NachoSoto disabled auto-merge November 17, 2023 19:58
@NachoSoto NachoSoto enabled auto-merge (squash) November 17, 2023 20:00
@NachoSoto NachoSoto merged commit e31a531 into main Nov 17, 2023
@NachoSoto NachoSoto deleted the http-client-test-headers branch November 17, 2023 20:19
tonidero pushed a commit that referenced this pull request Nov 30, 2023
**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)
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.

3 participants