Skip to content

Instantly share code, notes, and snippets.

@objectiveSee
Created August 21, 2014 02:39
Show Gist options
  • Save objectiveSee/b869c2048707a95299cc to your computer and use it in GitHub Desktop.
Save objectiveSee/b869c2048707a95299cc to your computer and use it in GitHub Desktop.
handleResponseReady: function(response) {
try {
if(AuthToken.isChanged(this.token)) {
this._response.setHeader('Set-Cookie', AuthCookie.cookieFromToken(this.token));
}
this._response.setHeader('Content-type', 'application/json');
this._response.end(JSON.stringify(response));
} catch(e) {
this.handleError(e);
}
},
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment