68701efb9e
The files served for the various versions on https://code.angularjs.org/ are retrieved by a Firebase function from a Firebase Storage bucket (where they are deployed to from Travis CI). The files are stored exactly as they are named on disk. It turns out that some of the files have names with special characters that get URI-encoded when sent to the Firebase function. For example, `input[text].html` becomes `input%5Btext%5D.html`. As a result, the actual file cannot be retrieved from the Storage bucket (since the name does not match) and `index.html` is returned instead. Apparently, this never worked, but nobody noticed or reported it until recently. An example of a failing URL is: https://code.angularjs.org/1.7.9/docs/api/ng/input/input%5Btext%5D (NOTE: https://docs.angularjs.org/ works correctly, since the files are deployed to Firebase hosting directly and not to a Storage bucket.) This commit fixes the problem by decoding the request path before trying to retrieve the corresponding file from the Storage bucket. Closes #16943
Firebase for code.angularjs.org
This folder contains the Google Firebase scripts for the code.angularjs.org setup.
firebase.json contains the rewrite rules that route every subdirectory request to the cloud function in functions/index.js that serves the docs from the Firebase Google Cloud Storage bucket.
functions/index.js also contains a rule that deletes outdated build zip files from the snapshot and snapshot-stable folders when new zip files are uploaded.
The deployment to the Google Cloud Storage bucket happens automatically via Travis. See the travis.yml file in the repository root.
See /readme.firebase.docs.md for the firebase deployment to docs.angularjs.org