Skip to content

docs(script-sdk): add docs for headers - INS-5438 - #8666

Merged
ihexxa merged 2 commits into
developfrom
doc/sdk/headers
Apr 30, 2025
Merged

docs(script-sdk): add docs for headers - INS-5438#8666
ihexxa merged 2 commits into
developfrom
doc/sdk/headers

Conversation

@ihexxa

@ihexxa ihexxa commented Apr 30, 2025

Copy link
Copy Markdown
Contributor

Changes

  • docs(script-sdk): add docs for headers

@ihexxa ihexxa self-assigned this Apr 30, 2025
@ihexxa
ihexxa force-pushed the doc/sdk/headers branch 2 times, most recently from 67b04c7 to e08834e Compare April 30, 2025 03:14
@cwangsmv
cwangsmv requested a review from Copilot April 30, 2025 05:49

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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), {})];

@ihexxa
ihexxa enabled auto-merge (squash) April 30, 2025 06:52
@ihexxa
ihexxa merged commit 20b735b into develop Apr 30, 2025
@ihexxa
ihexxa deleted the doc/sdk/headers branch April 30, 2025 07:05
cwangsmv pushed a commit that referenced this pull request Jun 10, 2025
* docs(script-sdk): add docs for headers

* fix: smoke test
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.

3 participants