B2G/gecko/services/common/tests/unit/test_storage_server.js
/**
 * Helper function to prepare a RESTRequest against the server.
 */
Helper function to prepare a RESTRequest against the server.
Helper function to prepare a RESTRequest against the server .
function localRequest(path, user=DEFAULT_USER, password=DEFAULT_PASSWORD) {
  _("localRequest: " + path);
  let url = "http://127.0.0.1:" + PORT + path;
  _("url: " + url);
  let req = new RESTRequest(url);
  let header = basic_auth_header(user, password);
  req.setHeader("Authorization", header);
  req.setHeader("Accept", "application/json");
  return req;
}
function localRequest ( path , user = DEFAULT_USER , password = DEFAULT_PASSWORD ) { _ ( "localRequest: " + path ) ; let url = "http://127.0.0.1:" + PORT + path ; _ ( "url: " + url ) ; let req = new RESTRequest ( url ) ; let header = basic_auth_header ( user , password ) ; req . setHeader ( "Authorization" , header ) ; req . setHeader ( "Accept" , "application/json" ) ; return req ; }
Helper function to prepare a RESTRequest against the server.
Helper function to prepare a RESTRequest against the server .