Skip to content

Commit 6d08a8b

Browse files
committed
fix code.angularjs response
1 parent 0aee40c commit 6d08a8b

File tree

2 files changed

+15
-9
lines changed

2 files changed

+15
-9
lines changed
Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,21 @@
11
{
22
"hosting": {
33
"public": "public",
4-
"redirects": [ {
5-
"source" : "/:version/docs",
6-
"destination" : "/:version/docs/index.html",
7-
"type" : 301
8-
}],
4+
"redirects": [
5+
{
6+
"source": "/:version/docs",
7+
"destination": "/:version/docs/index.html",
8+
"type": 301
9+
}
10+
],
911
"rewrites": [
1012
{
1113
"source": "/**",
1214
"function": "sendStoredFile"
1315
}
1416
]
17+
},
18+
"storage": {
19+
"rules": "storage.rules"
1520
}
1621
}

scripts/code.angularjs.org-firebase/functions/index.js

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -55,10 +55,11 @@ function sendStoredFile(request, response) {
5555
return bucket.file(downloadPath).download({
5656
destination: `/tmp/${fileName}`
5757
}).then(() => {
58-
return response.status(200).set({
59-
'Content-Encoding': 'gzip',
60-
'Cache-Control': 'public, max-age=300, s-maxage=600'
61-
}).sendFile(`${LOCAL_TMP_FOLDER}${fileName}`);
58+
return response.status(200)
59+
.set({
60+
'Cache-Control': 'public, max-age=300, s-maxage=600'
61+
})
62+
.sendFile(`${LOCAL_TMP_FOLDER}${fileName}`);
6263
});
6364
}
6465
}

0 commit comments

Comments
 (0)