Skip to content

Remove Content-Length header from nock responses#3839

Merged
dskloetc merged 1 commit intomainfrom
chore/kloet/content-length
May 6, 2025
Merged

Remove Content-Length header from nock responses#3839
dskloetc merged 1 commit intomainfrom
chore/kloet/content-length

Conversation

@dskloetc
Copy link
Contributor

@dskloetc dskloetc commented May 6, 2025

Description

The update to nock v14 breaks a lot of tests.
Most (but not all) of the tests break because we specify an incorrect Content-Length header in the mock response.
It seems like previously the incorrect header was just ignored or replaced and now it actually determines the length of the response. So the response gets cut off in the middle and can't be parsed as JSON.

Removing the Content-Length header from the mock response works fine and is a lot easier than figuring out the correct value for each of these.

Changes

Remove Content-Length header from all nock responses.
I did not try only removing the ones that cause failures. I just removed all of them.

Steps to Test

After applying this change on the nock update PR, the number of failing tests went from 114 to 3.

Quality Assurance

  • If a new adapter was made, or an existing one was modified so that its environment variables have changed, update the relevant infra-k8s configuration file.
  • If a new adapter was made, or an existing one was modified so that its environment variables have changed, update the relevant adapter-secrets configuration file or update the soak testing blacklist.
  • If a new adapter was made, or a new endpoint was added, update the test-payload.json file with relevant requests.
  • The branch naming follows git flow (feature/x, chore/x, release/x, hotfix/x, fix/x) or is created from Jira.
  • This is related to a maximum of one Jira story or GitHub issue.
  • Types are safe (avoid TypeScript/TSLint features like any and disable, instead use more specific types).
  • All code changes have 100% unit and integration test coverage. If testing is not applicable or too difficult to justify doing, the reasoning should be documented explicitly in the PR.

@changeset-bot
Copy link

changeset-bot bot commented May 6, 2025

⚠️ No Changeset found

Latest commit: 8a10618

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@dskloetc dskloetc marked this pull request as ready for review May 6, 2025 08:30
@dskloetc dskloetc requested a review from a team May 6, 2025 08:38
@dskloetc dskloetc merged commit b82869f into main May 6, 2025
16 checks passed
@dskloetc dskloetc deleted the chore/kloet/content-length branch May 6, 2025 11:42
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.

2 participants