Skip to content

Commit

Permalink
Fixing the browsable status header value
Browse files Browse the repository at this point in the history
  • Loading branch information
avoidwork committed Mar 29, 2015
1 parent 579e38e commit 5798ec4
Show file tree
Hide file tree
Showing 7 changed files with 13 additions and 10 deletions.
2 changes: 1 addition & 1 deletion doc/global.html
Original file line number Diff line number Diff line change
Expand Up @@ -1826,7 +1826,7 @@ <h5>Returns:</h5>

<span class="jsdoc-message">
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.2.2</a>
on 2015-03-29T17:55:32-04:00 using the <a
on 2015-03-29T18:23:25-04:00 using the <a
href="https://github.com/terryweiss/docstrap">DocStrap template</a>.
</span>
</footer>
Expand Down
2 changes: 1 addition & 1 deletion doc/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -386,7 +386,7 @@ <h2>License</h2>

<span class="jsdoc-message">
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.2.2</a>
on 2015-03-29T17:55:33-04:00 using the <a
on 2015-03-29T18:23:25-04:00 using the <a
href="https://github.com/terryweiss/docstrap">DocStrap template</a>.
</span>
</footer>
Expand Down
2 changes: 1 addition & 1 deletion doc/module-tenso.html
Original file line number Diff line number Diff line change
Expand Up @@ -344,7 +344,7 @@ <h5>Type:</h5>

<span class="jsdoc-message">
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.2.2</a>
on 2015-03-29T17:55:33-04:00 using the <a
on 2015-03-29T18:23:25-04:00 using the <a
href="https://github.com/terryweiss/docstrap">DocStrap template</a>.
</span>
</footer>
Expand Down
2 changes: 1 addition & 1 deletion doc/modules.list.html
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@ <h2>

<span class="jsdoc-message">
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.2.2</a>
on 2015-03-29T17:55:33-04:00 using the <a
on 2015-03-29T18:23:25-04:00 using the <a
href="https://github.com/terryweiss/docstrap">DocStrap template</a>.
</span>
</footer>
Expand Down
5 changes: 3 additions & 2 deletions lib/tenso.es6.js
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ class Tenso {
* @param {Object} headers HTTP response headers
* @return {String} HTTP response body
*/
render ( req, arg, headers, status ) {
render ( req, arg, headers ) {
let accept = req.headers.accept || "application/json";
let accepts = string.explode( accept, ";" );
let format = "json";
Expand Down Expand Up @@ -227,9 +227,10 @@ class Tenso {
ref[ 0 ][ this.server.config.security.key ] = res.locals[ this.server.config.security.key ];
}

status = status || 200;
ref[ 0 ] = this.server.headers( req, ref[ 0 ], status );

this.server.respond( req, res, this.render( req, hypermedia( this.server, req, response( arg, status ), ref[ 0 ] ), ref[ 0 ], status ), status, ref[ 0 ] );
this.server.respond( req, res, this.render( req, hypermedia( this.server, req, response( arg, status ), ref[ 0 ] ), ref[ 0 ] ), status, ref[ 0 ] );
}

return this;
Expand Down
5 changes: 3 additions & 2 deletions lib/tenso.js
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,7 @@ var Tenso = (function () {
* @return {String} HTTP response body
*/

value: function render(req, arg, headers, status) {
value: function render(req, arg, headers) {
var accept = req.headers.accept || "application/json";
var accepts = string.explode(accept, ";");
var format = "json";
Expand Down Expand Up @@ -254,9 +254,10 @@ var Tenso = (function () {
ref[0][this.server.config.security.key] = res.locals[this.server.config.security.key];
}

status = status || 200;
ref[0] = this.server.headers(req, ref[0], status);

this.server.respond(req, res, this.render(req, hypermedia(this.server, req, response(arg, status), ref[0]), ref[0], status), status, ref[0]);
this.server.respond(req, res, this.render(req, hypermedia(this.server, req, response(arg, status), ref[0]), ref[0]), status, ref[0]);
}

return this;
Expand Down
5 changes: 3 additions & 2 deletions src/constructor.js
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ class Tenso {
* @param {Object} headers HTTP response headers
* @return {String} HTTP response body
*/
render ( req, arg, headers, status ) {
render ( req, arg, headers ) {
let accept = req.headers.accept || "application/json";
let accepts = string.explode( accept, ";" );
let format = "json";
Expand Down Expand Up @@ -160,9 +160,10 @@ class Tenso {
ref[ 0 ][ this.server.config.security.key ] = res.locals[ this.server.config.security.key ];
}

status = status || 200;
ref[ 0 ] = this.server.headers( req, ref[ 0 ], status );

this.server.respond( req, res, this.render( req, hypermedia( this.server, req, response( arg, status ), ref[ 0 ] ), ref[ 0 ], status ), status, ref[ 0 ] );
this.server.respond( req, res, this.render( req, hypermedia( this.server, req, response( arg, status ), ref[ 0 ] ), ref[ 0 ] ), status, ref[ 0 ] );
}

return this;
Expand Down

0 comments on commit 5798ec4

Please sign in to comment.