New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

hapi-vary-accept

Package Overview
Dependencies
Maintainers
1
Versions
9
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

hapi-vary-accept

hapi pre-response handler to include Accept in the Vary header

latest
Source
npmnpm
Version
3.0.3
Version published
Weekly downloads
29
-9.37%
Maintainers
1
Weekly downloads
 
Created
Source

hapi-vary-accept

hapi pre-response handler to include Accept in the Vary header

Codecov Node CI Workflow Status

Table of Contents

Motivation

Google Chrome caches only the last response for any endpoint, regardless of content-type, which results in rendering json data instead of the rendered page based on the html representation. These values are cached even with the Cache-Control header set to no-cache in order to optimize operations like navigating back or duplicating a tab.

While normally unnecessary because of configuring the headers to prevent caching,including Accept in the Vary header does technically further inform a client that a single endpoint responds with different responses based on the Accept header of the request.

Usage

npm MIT license

Installation

:warning: This plugin does not yet support hapi v17

$ npm install hapi-vary-accept --save

Contribution

Conventional Commits Commitizen friendly semantic-release Renovate

Verification

$ npm test

FAQs

Package last updated on 23 Sep 2023

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts