Skip to content

RequestHelpers

Check if two urls are mostly equal

Will first trim out white spaces, and can omit the last /

For example, https://www.example.com/ and https://www.example.com are considered equal

Basically urlEquals, but without length constraint.

For example, https://www.example.com/ and www.example.com are considered contains.

Compare two DAV hrefs as resource identifiers after resolving relative hrefs against baseUrl and normalizing percent-encoding differences (for example /principals/a@b.com/ and /principals/a%40b.com/).

Ensure a directory or collection URL ends with a trailing / before any query string (?) or fragment (#), so relative new URL(href, base) resolution targets children inside the collection.

Convert DAVNamespace to intended format to be consumed by xml-js to be used as xml attributes.

Clean up falsy values within an object, this is useful when sending headers, where an undefined object property would otherwise be stringified.

Case-insensitively remove headers whose names appear in headersToExclude.

Merge any combination of HeadersInit sources (Record<string, string>, Headers, or [string, string][]) with case-insensitive last-write-wins semantics.