Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

normalize channel names on hosting:channel:create and remove hashes #2784

Merged
merged 2 commits into from
Nov 5, 2020

Conversation

bkendall
Copy link
Contributor

@bkendall bkendall commented Nov 5, 2020

Description

Fixes #2783

hosting:channel:deploy does normalizing of the channel ID provided. :create was not. Further, the normalization wasn't removing # from the provided IDs and causing issues when passed into a URL.

Scenarios Tested

  • firebase hosting:channel:create test#bar
  • firebase hosting:channel:deploy test#bar

@google-cla google-cla bot added the cla: yes Manual indication that this has passed CLA. label Nov 5, 2020
@@ -160,7 +160,7 @@ export interface Version {
*/
export function normalizeName(s: string): string {
// Using a regex replaces *all* bad characters.
return s.replace(/[/:_]/g, "-");
return s.replace(/[/:_#]/g, "-");
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Instead of "all bad characters" maybe specify which characters are being replaced

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The jsdoc comment is now updated to include #. But this comment is about using regex to replace the characters rather than another mechanism. I made it more specific.

@bkendall bkendall merged commit d719419 into master Nov 5, 2020
@bkendall bkendall deleted the bk-2783 branch November 5, 2020 20:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cla: yes Manual indication that this has passed CLA.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

hosting:channel:deploy partial deployment and 404 error when channel ID contains "#"
2 participants