RequestHelpers
urlEquals
Section titled “urlEquals”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
urlContains
Section titled “urlContains”Basically urlEquals, but without length constraint.
For example, https://www.example.com/ and www.example.com are considered contains.
urlMatches
Section titled “urlMatches”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/).
ensureTrailingSlash
Section titled “ensureTrailingSlash”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.
getDAVAttribute
Section titled “getDAVAttribute”Convert DAVNamespace to intended format to be consumed by xml-js to be used as xml attributes.
cleanupFalsy
Section titled “cleanupFalsy”Clean up falsy values within an object, this is useful when sending headers,
where an undefined object property would otherwise be stringified.
excludeHeaders
Section titled “excludeHeaders”Case-insensitively remove headers whose names appear in headersToExclude.
mergeHeaders
Section titled “mergeHeaders”Merge any combination of HeadersInit sources (Record<string, string>, Headers, or [string, string][]) with case-insensitive last-write-wins semantics.