Skip to content

v22.1.0

Latest

Choose a tag to compare

@brandonlehmann brandonlehmann released this 17 May 15:53
2240fb0

What's new

This release expands HTTP method coverage beyond the standard nine, adding first-class helpers for WebDAV, CalDAV, and several adjacent IETF specifications. Fifteen new method helpers, no breaking changes.

New method helpers

  • WebDAV (RFC 4918): propFind, propPatch, mkCol, copy, move, lock, unlock
  • CalDAV (RFC 4791): mkCalendar, report
  • ACL (RFC 3744): acl
  • DAV Search (RFC 5323): search
  • HTTP QUERY (draft-ietf-httpbis-safe-method-w-body): query
  • WebDAV Bindings (RFC 5842): bind, unbind, rebind

Each helper is available on both @gibme/fetch (Node.js) and @gibme/fetch/browser, with the same (url, init) signature as the existing helpers:

import fetch from '@gibme/fetch';

// Create a WebDAV collection
await fetch.mkCol('https://dav.example.com/new-folder/');

// PROPFIND with Depth header
await fetch.propFind('https://dav.example.com/calendars/', {
    headers: { Depth: '1' }
});

// CalDAV REPORT against a calendar collection
await fetch.report('https://dav.example.com/calendars/personal/', {
    headers: { Depth: '1', 'Content-Type': 'application/xml' },
    body: reportXml
});

Internals

  • HTTP_METHODS and HTTP_METHOD_BODY_REMOVE are now exported from the helpers module so callers can introspect the supported set.
  • Body stripping for GET, HEAD, OPTIONS, TRACE, and CONNECT is driven by the shared constant.
  • Method whitelist in normalizeInit is driven by the same source of truth that the test suite imports.

Compatibility

  • No breaking changes. All existing helpers and types are unchanged.
  • DELETE continues to retain a request body when supplied.
  • UNLOCK retains a request body when supplied (RFC 4918 section 9.11 defines no body but does not forbid one).
  • All 15 new methods carry request bodies through unchanged where supplied, matching their respective specs.

Full diff: v22.0.1...v22.1.0