Skip to content

Commit

Permalink
Adding coerce: true to the config, updating dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
avoidwork committed Oct 1, 2017
1 parent ffa42bc commit 6720b42
Show file tree
Hide file tree
Showing 5 changed files with 574 additions and 2,836 deletions.
1 change: 1 addition & 0 deletions config.json
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@
"ignore": []
},
"compress": true,
"coerce": true,
"headers": {
"cache-control": "max-age=60, must-revalidate"
},
Expand Down
1 change: 1 addition & 0 deletions lib/tenso.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ class Tenso {
default: "localhost",
cacheSize: 1000,
catchAll: true,
coerce: true,
compress: true,
etags: {
notify: false,
Expand Down
5 changes: 3 additions & 2 deletions lib/utility.js
Original file line number Diff line number Diff line change
Expand Up @@ -568,6 +568,7 @@ function bootstrap (obj) {

obj.router = woodland({
cacheSize: obj.config.cacheSize,
coerce: obj.config.coerce,
defaultHost: obj.config.default,
defaultHeaders: obj.config.headers,
hosts: Reflect.ownKeys(obj.config.hosts),
Expand Down Expand Up @@ -695,8 +696,8 @@ function hypermedia (server, req, rep, headers) {
}

query = req.parsed.query;
page = query.page || 1;
page_size = query.page_size || server.config.pageSize || 5;
page = Number(query.page) || 1;
page_size = Number(query.page_size || server.config.pageSize) || 5;
root = req.parsed.pathname;

if (req.parsed.pathname !== "/") {
Expand Down
Loading

0 comments on commit 6720b42

Please sign in to comment.