Regular expression for identifying a bytes Range header.
RegExp to match non-URL code points, after encoding (i.e. not including "%") and including invalid escape sequences.
Maximum value allowed for the max age.
RegExp to match unmatched surrogate pair.
String to replace unmatched surrogate pair with.
Regular expression to match a path with a directory up component.
Transfer the file at path
.
Clear all headers from a response.
Collapse all leading slashes into a single slash
Determine if path parts contain a dotfile.
Create a Content-Range header.
Create a 404 error.
decodeURIComponent.
Allows V8 to only de-optimize this fn instead of all of send().
Encode a URL to a percent-encoded form, excluding already-encoded sequences.
This function will take an already-encoded URL and encode all the non-URL
code points. This function will not encode the "%" character unless it is
not part of a valid sequence (%20
will be left as-is, but %foo
will
be encoded as %25foo
).
This encode is meant to be "safe" and does not throw errors. It will try as hard as it can to properly encode the given URL, including replacing any raw, unpaired surrogate pairs with the Unicode replacement character prior to encoding.
Check if the pathname ends with "/" or "\" (os dependent).
Check if the request is cacheable, aka responded with 2xx or 304 (see RFC 2616 section 14.2{5,6}).
Check if this is a conditional GET request.
Check if the request preconditions failed.
Check if the range is fresh.
Normalize the index option into an array.
Sets the read offset of the provided file and returns a Deno.Reader & Deno.Closer to read the file from the offset until the provided contentLength;
reader closer
Strip content-* header fields.
Emit errors.
Generated using TypeDoc
Heavily inspired by send (https://github.com/pillarjs/send/tree/0.17.1)
send is licensed as follows:
(The MIT License)
Copyright (c) 2012 TJ Holowaychuk Copyright (c) 2014-2016 Douglas Christopher Wilson
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the 'Software'), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.