Skip to main content
Module

x/http_compress/deps.ts

Compress HTTP response, supported Web standard compression methods
Latest
import * as httpCompress from "https://deno.land/x/http_compress@1.0.1/deps.ts";

Functions

Returns an array of content encodings accepted by the request, in order of preference. If there are no encoding supplied in the request, then ["*"] is returned, implying any encoding is accepted.

Compress a byte array.

Merge two Headers object. The first Headers always takes precedence. When fields conflict, the first Headers takes precedence if it is a singleton field. If it is a list-based field and not empty, it is appended to the first Headers field. Invalid field names and field values are ignored. No destructive operation is performed on the arguments and returns a new Headers object.

Parses the media type and any optional parameters, per RFC 1521. Media types are the values in Content-Type and Content-Disposition headers. On success the function returns a tuple where the first element is the media type and the second element is the optional parameters or undefined if there are none.

Safely returns a Response object. Wraps operations that may cause errors and returns a 500 internal server error response if an error occurs.

Type Aliases

HTTP request handler.