Module

x/oak/mod.ts>etag

A middleware framework for handling HTTP with Deno 🐿️ 🦕
Extremely Popular
Go to Latest
namespace etag
import { etag } from "https://dotland.deno.dev/x/oak@v14.1.0/mod.ts";

A collection of oak specific APIs for management of ETags.

Functions

Calculate an ETag for an entity. When the entity is a specific set of data it will be fingerprinted as a "strong" tag, otherwise if it is just file information, it will be calculated as a weak tag.

Create middleware that will attempt to decode the response.body into something that can be used to generate an ETag and add the ETag header to the response.

For a given Context, try to determine the response body entity that an ETag can be calculated from.

A helper function that takes the value from the If-Match header and a calculated etag for the target. By using strong comparison, return true if the values match, otherwise false.

A helper function that takes the value from the If-None-Match header and a calculated etag for the target entity and returns false if the etag for the entity matches the supplied value, otherwise true.

Interfaces

Options for {@link calculate}.

Just the part of Deno.FileInfo that is required to calculate an ETag, so partial or user generated file information can be passed.