From 0f6a433c308b7f97d5b9560e49ad1a8392e6f8f9 Mon Sep 17 00:00:00 2001 From: Grzegorz Daszuta Date: Tue, 16 Aug 2016 10:07:04 +0200 Subject: [PATCH 1/3] allow override content-type --- server/router.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/server/router.js b/server/router.js index 54ee1c17..f98d56ae 100644 --- a/server/router.js +++ b/server/router.js @@ -86,7 +86,11 @@ ServerRouter.prototype.getHandler = function(action, pattern, route) { res.render(viewPath, viewData, function(err, html) { if (err) return next(err); - res.type('html'); + + if(!res.get('content-type')) { + res.type('html'); + } + res.set(router.getHeadersForRoute(route)); res.end(html); }); From d110fb9bf2e24e667026e2e6afb7cc3f4e284f8f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jurek=20Wo=C5=BAniak?= Date: Mon, 22 Aug 2016 13:50:38 +0200 Subject: [PATCH 2/3] changed hydrate method: try to refresh cache if empty --- shared/fetcher.js | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/shared/fetcher.js b/shared/fetcher.js index 4ff6adf3..112840d5 100644 --- a/shared/fetcher.js +++ b/shared/fetcher.js @@ -279,7 +279,20 @@ Fetcher.prototype.hydrate = function(summaries, options, callback) { // Also support getting all models for a collection. fetcher.collectionStore.get(summary.collection, summary.params, function(collection) { if (collection == null) { - throw new Error("Collection of type \"" + summary.collection + "\" not found for params: " + JSON.stringify(summary.params)); + return fetcher.fetch({ + collection: { + collection: summary.collection, + params: summary.params + } + }, null, function(err, res){ + if (err) { + cb(err); + } else { + results[name] = res.collection; + cb(null); + } + }); + } results[name] = collection; From c69d814238827f9272b4661fe5596f26726f4482 Mon Sep 17 00:00:00 2001 From: Andrzej WP Date: Tue, 25 Oct 2016 02:24:05 +0200 Subject: [PATCH 3/3] add default timeout --- server/data_adapter/rest_adapter.js | 1 + 1 file changed, 1 insertion(+) diff --git a/server/data_adapter/rest_adapter.js b/server/data_adapter/rest_adapter.js index 5a154b4d..8e738957 100644 --- a/server/data_adapter/rest_adapter.js +++ b/server/data_adapter/rest_adapter.js @@ -126,6 +126,7 @@ RestAdapter.prototype.apiDefaults = function(api, req) { _.defaults(api, { method: 'GET', + timeout: 15000, // 15 seconds default url: url.format(urlOpts), headers: {} });