noopen.js 419 B

123456789101112131415
  1. 'use strict';
  2. const utils = require('../utils');
  3. // @see http://blogs.msdn.com/b/ieinternals/archive/2009/06/30/internet-explorer-custom-http-headers.aspx
  4. module.exports = options => {
  5. return async function noopen(ctx, next) {
  6. await next();
  7. const opts = utils.merge(options, ctx.securityOptions.noopen);
  8. if (utils.checkIfIgnore(opts, ctx)) return;
  9. ctx.set('x-download-options', 'noopen');
  10. };
  11. };