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 setting default value of request.PostData of HarEntry #323

Merged
merged 2 commits into from
Jul 12, 2024

Conversation

nsrCodes
Copy link
Contributor

since har entry is of type [src]

interface Entry {
  request: Partial<HarRequest>;
}

so request.postData could have the value undefined

The current approach of setting the default value for this key will fail when postData is undefined

This then breaks the switch case inside the prepare method because there is no optional chaining

This PR is broken into two commits. If only either one feels sufficient, the changes can be cherry-picked or both can be squashed.

src/httpsnippet.ts Outdated Show resolved Hide resolved
@CLAassistant
Copy link

CLAassistant commented Jun 27, 2024

CLA assistant check
All committers have signed the CLA.

@filfreire filfreire merged commit e99422a into Kong:master Jul 12, 2024
8 checks passed
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.

4 participants