How to use the vary.default function in vary

To help you get started, we’ve selected a few vary examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github ethanresnick / json-api / build / src / http-strategies / Koa.js View on Github external
sendResources(responseObject, ctx) {
        const _a = responseObject.headers, { vary } = _a, otherHeaders = __rest(_a, ["vary"]);
        if (vary) {
            vary_1.default(ctx.res, vary);
        }
        if (responseObject.status === 406 && !this.config.handleContentNegotiation) {
            return true;
        }
        ctx.status(responseObject.status || 200);
        Object.keys(otherHeaders).forEach(k => {
            ctx.res.set(k, otherHeaders[k]);
        });
        if (responseObject.body !== undefined) {
            ctx.body = new Buffer(responseObject.body);
        }
    }
    sendError(errors, ctx) {

vary

Manipulate the HTTP Vary header

MIT
Latest version published 7 years ago

Package Health Score

67 / 100
Full package analysis

Popular vary functions