Skip to content

Instantly share code, notes, and snippets.

@hoorayimhelping
Created July 19, 2016 18:14
Show Gist options
  • Select an option

  • Save hoorayimhelping/8782708327e13e9965f3c56d75b6bf47 to your computer and use it in GitHub Desktop.

Select an option

Save hoorayimhelping/8782708327e13e9965f3c56d75b6bf47 to your computer and use it in GitHub Desktop.
export { USER_ID_HEADER, REQUEST_ID_HEADER } from '../settings';
import { COLLAB_AUTH_NAME, COLLAB_AUTH_PASSWORD } from '../settings';
import ServerRequest from 'qh-common/server/utils/server-request';
export const buildServerRequestObject =
(req = null, basicAuthName = COLLAB_AUTH_NAME, basicAuthPassword = COLLAB_AUTH_PASSWORD) => {
let serverRequest = new ServerRequest(basicAuthName, basicAuthPassword);
if (req) {
serverRequest.setHeaders(serverRequest.defaultHeadersFromReq(req));
}
return serverRequest;
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment