Skip to content

Commit

Permalink
Updating render() to assign accepts such that it is equal to `ser…
Browse files Browse the repository at this point in the history
…ializer()`
  • Loading branch information
avoidwork committed Jan 29, 2019
1 parent 15e1da9 commit 1fb4678
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions lib/tenso.js
Original file line number Diff line number Diff line change
Expand Up @@ -377,13 +377,13 @@ class Tenso extends Base {
return [valid, limit, remaining, reset];
}

render (req, res, arg, headers) {
render (req, res, arg, headers = {}) {
if (arg === null) {
arg = "null";
}

let format = "",
accepts = utility.explode(req.parsed.searchParams.get("format") || req.headers.accept || format, ","),
accepts = utility.explode(headers["content-type"] || req.parsed.searchParams.get("format") || req.headers.accept || format, ","),
decorated = res.getHeaders(),
renderer;

Expand Down
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "tenso",
"description": "Tensō is an HTTP/HTTP2 REST API framework",
"version": "10.2.6",
"version": "10.2.7",
"homepage": "http://avoidwork.github.io/tenso",
"author": "Jason Mulligan <[email protected]>",
"repository": {
Expand Down

0 comments on commit 1fb4678

Please sign in to comment.