lib/services/mock-filename-generator.js
function defaultMockFilename(config, req) {
    var reqData = prismUtils.filterUrl(config, req.url);
    // include request body in hash
    if (config.hashFullRequest(config, req)) {
      reqData = req.body + reqData;
    }

    var shasum = crypto.createHash('sha1');
    shasum.update(reqData);
    return shasum.digest('hex') + '.json';
  }
function defaultMockFilename(config, req) {
    var reqData = prismUtils.filterUrl(config, req.url);
    // include request body in hash
    if (config.hashFullRequest(config, req)) {
      reqData = req.body + reqData;
    }

    var shasum = crypto.createHash('sha1');
    shasum.update(reqData);
    return shasum.digest('hex') + '.json';
  }
function defaultMockFilename ( config , req ) { var reqData = prismUtils . filterUrl ( config , req . url ) ; // include request body in hash if ( config . hashFullRequest ( config , req ) ) { reqData = req . body + reqData ; } var shasum = crypto . createHash ( 'sha1' ) ; shasum . update ( reqData ) ; return shasum . digest ( 'hex' ) + '.json' ; }
This is the default implementation to generate a filename for the recorded
responses.  It will create a sha1 hash of the request URL and optionally,
the body of the request if the `hashFullRequest` config is set to true.
This function can be overidden in config with the responseFilenameCallback
setting.
This is the default implementation to generate a filename for the recorded responses . It will create a sha1 hash of the request URL and optionally the body of the request if the hashFullRequest config is set to true . This function can be overidden in config with the responseFilenameCallback setting .