Skip to content

fix: make xml shortcut match text/xml and application/xml (Fixes #24) - #112

Closed
dyk1454683243-sudo wants to merge 1 commit into
jshttp:masterfrom
dyk1454683243-sudo:cursor/xml-shortcut-text-xml-5058
Closed

dyk1454683243-sudo wants to merge 1 commit into
jshttp:masterfrom
dyk1454683243-sudo:cursor/xml-shortcut-text-xml-5058

Conversation

@dyk1454683243-sudo

@dyk1454683243-sudo dyk1454683243-sudo commented Sep 20, 2026 •

Copy link
Copy Markdown

Summary

new TypeIs(['xml']) did not match text/xml because the xml shorthand was not mapped in DEFAULT_LOOKUP.

Both application/xml and text/xml are valid XML types, so map the shortcut to both. TypeIs already expands string[] from normalize — no other API change.

Fixes #24

Test plan

  • Specs: shorthand xml matches both application/xml and text/xml (TypeIs#request, TypeIs#is, and normalize)
  • npm test — 315 passed (prettier + tsc + vitest)

Map the xml type shorthand to both application/xml and text/xml so
is/request checks treat both as valid XML content types.

Fixes jshttp#24

Co-authored-by: David <dyk1454683243-sudo@users.noreply.github.com>
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.

is(req, 'xml') should be true when content-type is text/xml

3 participants