Skip to content

Using --alias with invalid characters "slugifies" the string in the shell but sends the characters unchanged to Deploy.subdomain_alias. #969

Open
@overlordofmu

Description

@overlordofmu

- Do you want to request a feature or report a bug?

A bug.

- What is the current behavior?

When using --alias to create a custom subdomain for a deploy, characters which would be invalid for a domain name are "slugified" in the shell URL but the database is still getting the unmodified string.

- If the current behavior is a bug, please provide the steps to reproduce.

Here is an example deploy:

$ netlify deploy --alias="not/working"
Deploy path:        /Users/me/data/git/overlordofmu/netlify-cli-manual-deploys/public
Configuration path: /Users/me/data/git/overlordofmu/netlify-cli-manual-deploys/netlify.toml
Deploying to draft URL...
✔ Finished hashing 8 files
✔ CDN requesting 0 files
✔ Finished uploading 0 assets
✔ Deploy is live!

Logs:              https://app.netlify.com/sites/netlify-cli-manual-deploys/deploys/5efaea211010bad6650a7350
Website Draft URL: https://not-working--netlify-cli-manual-deploys.netlify.app

If everything looks good on your draft URL, deploy it to your main site URL with the --prod flag.
netlify deploy --prod

However, if I check the actual content of Deploy.subdomain_alias it is "not/working" instead of not-working. The URL in the deploy above does not work: https://not-working--netlify-cli-manual-deploys.netlify.app

- What is the expected behavior?

That the same "slugified" string shown in the shell command output be used for the subdomain_alias value and the given URL in the shell will then work.

- Local Environment Information

$ netlify version --verbose
────────────────────┐
 Environment Info   │
────────────────────┘

  System:
    OS: macOS 10.15.5
    CPU: (12) x64 Intel(R) Core(TM) i7-8750H CPU @ 2.20GHz
  Binaries:
    Node: 12.18.0 - ~/.nvm/versions/node/v12.18.0/bin/node
    Yarn: 1.22.4 - /usr/local/bin/yarn
    npm: 6.14.4 - ~/.nvm/versions/node/v12.18.0/bin/npm
  Browsers:
    Chrome: 83.0.4103.116
    Firefox: 77.0.1
    Safari: 13.1.1
  npmGlobalPackages:
    netlify-cli: 2.54.0

netlify-cli/2.54.0 darwin-x64 node-v12.18.0

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions