commit 2e28dfc97175aacd5e0db7408ce21ec6992393f9
parent e713d53457887b9e1ea65fe06642e3e6e2198f2e
Author: Konstantin Tarkus <koistya@gmail.com>
Date: Wed, 20 Jan 2016 23:35:39 +0300
Merge pull request #415 from andantonyan/master
fix(routes.js): check response status.
Diffstat:
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/routes.js b/src/routes.js
@@ -33,7 +33,7 @@ const router = new Router(on => {
on('*', async (state) => {
const response = await fetch(`/api/content?path=${state.path}`);
const content = await response.json();
- return content && <ContentPage {...content} />;
+ return response.ok && content && <ContentPage {...content} />;
});
on('error', (state, error) => state.statusCode === 404 ?