docs: function handleAcceptRequest(req, res, handlers, fallbackHandler) {
    var config = req.app.get('stormpathConfig');
  
    // Accepted is an ordered list of preferred types, as specified by the request.
    var accepted = req.accepts();
    var produces = config.web.produces;
  
    // Our default response is HTML, if the client does not specify something more
    // specific.  As such, map the wildcard type to html.
    accepted = accepted.map(function (contentType) {
      return contentType === '*/*' ? 'text/html' : contentType;
    });
  
    // Of the accepted types, find the ones that are allowed by the configuration.
    var allowedResponseTypes = _.intersection(produces, accepted);
  
    // Of the allowed response types, find the first handler that matches. But
    // always override with the SPA handler if SPA is enabled.
    var handler;
  
    allowedResponseTypes.some(function (contentType) {
      if (config.web.spa.enabled && contentType === 'text/html') {
        handler = spaResponseHandler(config);
        return true;
      }
  
      if (contentType in handlers) {
        handler = handlers[contentType];
        return true;
      }
    });
  
    if (!handler) {
      return fallbackHandler();
    }
  
    handler(req, res);
  }