diff --git a/.gitignore b/.gitignore index 588beda3f17..3c5c85c57dc 100644 --- a/.gitignore +++ b/.gitignore @@ -12,6 +12,7 @@ performance/temp*.html angular.js.tmproj node_modules/ angular.xcodeproj +.firebase/ .idea *.iml .agignore diff --git a/package.json b/package.json index bf2e895bcf9..f8fc76ad30e 100644 --- a/package.json +++ b/package.json @@ -101,8 +101,8 @@ "dependencies": {}, "resolutions": { "//1": "`natives@1.1.0` does not work with Node.js 10.x on Windows 10", - "//2": "(E.g. see https://github.com/gulpjs/gulp/issues/2162.)", - "natives": "1.1.3" + "//2": "(E.g. see https://github.com/gulpjs/gulp/issues/2162 and https://github.com/nodejs/node/issues/25132.)", + "natives": "1.1.6" }, "commitplease": { "style": "angular", diff --git a/scripts/code.angularjs.org-firebase/functions/index.js b/scripts/code.angularjs.org-firebase/functions/index.js index 9dadc5495bd..eb2fcd0df8d 100644 --- a/scripts/code.angularjs.org-firebase/functions/index.js +++ b/scripts/code.angularjs.org-firebase/functions/index.js @@ -10,7 +10,11 @@ const BROWSER_CACHE_DURATION = 60 * 10; const CDN_CACHE_DURATION = 60 * 60 * 12; function sendStoredFile(request, response) { - const requestPath = request.path || '/'; + // Request paths will be URI-encoded, so we need to decode them to match the file names in the + // storage bucket. Failing to do so will result in a 404 error from the bucket and `index.html` + // will be returned instead. + // Example of path requiring decoding: `.../input%5Btext%5D.html` --> `.../input[text].html` + const requestPath = decodeURI(request.path || '/'); let filePathSegments = requestPath.split('/').filter((segment) => { // Remove empty leading or trailing path parts return segment !== ''; diff --git a/scripts/code.angularjs.org-firebase/functions/package.json b/scripts/code.angularjs.org-firebase/functions/package.json index 3e11c15cd8e..1fd6c00d851 100644 --- a/scripts/code.angularjs.org-firebase/functions/package.json +++ b/scripts/code.angularjs.org-firebase/functions/package.json @@ -1,6 +1,9 @@ { "name": "functions-firebase-code.angularjs.org", "description": "Cloud Functions to serve files from gcs to code.angularjs.org", + "engines": { + "node": "8" + }, "dependencies": { "@google-cloud/storage": "^1.1.1", "firebase-admin": "^5.11.0", diff --git a/yarn.lock b/yarn.lock index 16f6b27d758..d3a741657c5 100644 --- a/yarn.lock +++ b/yarn.lock @@ -5440,10 +5440,10 @@ nanomatch@^1.2.9: snapdragon "^0.8.1" to-regex "^3.0.1" -natives@1.1.3, natives@^1.1.0: - version "1.1.3" - resolved "https://registry.yarnpkg.com/natives/-/natives-1.1.3.tgz#44a579be64507ea2d6ed1ca04a9415915cf75558" - integrity sha512-BZGSYV4YOLxzoTK73l0/s/0sH9l8SHs2ocReMH1f8JYSh5FUWu4ZrKCpJdRkWXV6HFR/pZDz7bwWOVAY07q77g== +natives@1.1.6, natives@^1.1.0: + version "1.1.6" + resolved "https://registry.yarnpkg.com/natives/-/natives-1.1.6.tgz#a603b4a498ab77173612b9ea1acdec4d980f00bb" + integrity sha512-6+TDFewD4yxY14ptjKaS63GVdtKiES1pTPyxn9Jb0rBqPMZ7VcCiooEhPNsr+mqHtMGxa/5c/HhcC4uPEUw/nA== natural-compare@^1.4.0: version "1.4.0"