Module

x/oak/mod.ts>etag

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

A collection of APIs for dealing with ETags in requests and responses.

Functions

Calculate an ETag value for an entity. If the entity is FileInfo, then the tag will default to a weak ETag. options.weak overrides any default behavior in generating the 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 an entity and returns true if the ETag for the entity matches the supplied value, otherwise false.

A helper function that takes the value from the If-No-Match header and an entity and returns false if the ETag for the entity matches the supplied value, otherwise false.

Interfaces

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