docs(script-sdk): add docs for headers - INS-5438 - #8666
Merged
Conversation
ihexxa
force-pushed
the
doc/sdk/headers
branch
2 times, most recently
from
April 30, 2025 03:14
67b04c7 to
e08834e
Compare
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR enhances the documentation for HTTP header handling in the scripting SDK while aligning tests with the updated header interface.
- Removed the deprecated “type” property from header definitions and updated tests accordingly.
- Added comprehensive JSDoc comments to the Header and HeaderList classes to improve clarity and usage.
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| packages/insomnia-smoke-test/tests/smoke/pre-request-script-features.test.ts | Removed the unused "type" property from the header object in tests. |
| packages/insomnia-scripting-environment/src/objects/headers.ts | Enhanced the documentation for headers, removed the "type" property in the HeaderDefinition, and updated related constructor logic. |
Comments suppressed due to low confidence (1)
packages/insomnia-scripting-environment/src/objects/headers.ts:169
- The declared type for headerArray is inconsistent since unparseSingle returns a string. Consider changing the type to string[] and removing the unnecessary spread operator to avoid potential runtime issues.
const headerArray: { key: string; value: string }[] = [...headers.map(header => this.unparseSingle(header), {})];
cwangsmv
approved these changes
Apr 30, 2025
ihexxa
enabled auto-merge (squash)
April 30, 2025 06:52
cwangsmv
pushed a commit
that referenced
this pull request
Jun 10, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Changes