Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Fix setting default value of request.PostData of HarEntry#323

Merged
filfreire merged 2 commits intoKong:masterKong/httpsnippet:masterfrom
nsrCodes:fix-postdata-default-typensrCodes/httpsnippet:fix-postdata-default-typeCopy head branch name to clipboard
Jul 12, 2024
Merged

Fix setting default value of request.PostData of HarEntry#323
filfreire merged 2 commits intoKong:masterKong/httpsnippet:masterfrom
nsrCodes:fix-postdata-default-typensrCodes/httpsnippet:fix-postdata-default-typeCopy head branch name to clipboard

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
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

Morty Proxy This is a proxified and sanitized view of the page, visit original site.