'use strict';

Object.defineProperty(exports, '__esModule', {
  value: true
});

exports['default'] = function () {
  for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
    args[_key] = arguments[_key];
  }

  return function (req, res, next) {
    if ((req.method === 'GET' || req.method === 'HEAD') && req.accepts('html')) {
      var _ref;

      (_ref = res.sendFile || res.sendfile).call.apply(_ref, [res].concat(args, [function (err) {
        return err && next();
      }]));
    } else next();
  };
};

module.exports = exports['default'];
