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

Following URL is not valid: https://localhost:4200/xxx #29

Open
bobKasbi opened this issue Jan 30, 2020 · 4 comments
Open

Following URL is not valid: https://localhost:4200/xxx #29

bobKasbi opened this issue Jan 30, 2020 · 4 comments
Labels

Comments

@bobKasbi
Copy link

bobKasbi commented Jan 30, 2020

Current behavior

When I add the following URL: https://localhost:4200/xxxxx in the text filed, the url is not valid.

Expected/desired behavior

This URL: https://localhost:4200/xxxxx should be valid and accepted by the validator

Environment information

Angular CLI: 8.3.8
Node: 12.13.0
OS: darwin x64
Angular: 8.2.14
NPM: 6.12.0
Typescript: 3.4.5

Other information

@rsaenen
Copy link
Owner

rsaenen commented Jan 30, 2020

AFAIK, this is not a valid url.

It's an alias of a IP, it should has a domain to be valid.

@bobKasbi
Copy link
Author

bobKasbi commented Jan 30, 2020

Yes, it's endpoint of an API. We use a form input text to pass it to BE. Is there an attribute or HTML5 data-attribute for the input text to allow such kind of URL, or something similar?

Example:
<input type="text" [(ngModel)]="model.field" name="field" #field="ngModel" data-url="validate-api-endpoint" url>

or:
<input type="text" [(ngModel)]="model.field" name="field" #field="ngModel" data-url="allow-api-endpoint" url>

@bobKasbi
Copy link
Author

bobKasbi commented Feb 3, 2020

Any news here? Would be great if it's possible to add a kind of options such: https://github.com/validatorjs/validator.js

@kktos
Copy link

kktos commented Feb 8, 2020

Ralf,
I think if you allow any IP address, then localhost should be allowed too as it is a well known alias for 127.0.0.1.

Other the other sire, Bob, if you want, you can add in your /etc/hosts a FQDN with localhost as IP:
e.g:
www.bobkasbi.com 127.0.0.1
and use this "fake" FQDN in your code, rather than localhost.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants