Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions server/data_adapter/rest_adapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,7 @@ RestAdapter.prototype.apiDefaults = function(api, req) {

_.defaults(api, {
method: 'GET',
timeout: 15000, // 15 seconds default
url: url.format(urlOpts),
headers: {}
});
Expand Down
6 changes: 5 additions & 1 deletion server/router.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
});
Expand Down
15 changes: 14 additions & 1 deletion shared/fetcher.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down