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
@nsrCodes nsrCodes force-pushed the fix-postdata-default-type branch from 2535062 to d5e88ab Compare July 19, 2023 06:37
@CLAassistant
Copy link

CLAassistant commented Jun 27, 2024

CLA assistant check
All committers have signed the CLA.

@filfreire filfreire force-pushed the fix-postdata-default-type branch from d5e88ab to d888e39 Compare July 12, 2024 17:39
@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