-
Notifications
You must be signed in to change notification settings - Fork 324
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
NAS-134061 / 25.10 / Apps - UI validates uri
type more strictly than middleware
#11530
Conversation
uri
type more strictly than middlewareuri
type more strictly than middleware
Codecov ReportAll modified and coverable lines are covered by tests ✅
✅ All tests successful. No failed tests found. Additional details and impacted files@@ Coverage Diff @@
## master #11530 +/- ##
==========================================
- Coverage 83.27% 83.27% -0.01%
==========================================
Files 1654 1654
Lines 59081 59081
Branches 6352 6352
==========================================
- Hits 49200 49197 -3
- Misses 9881 9884 +3 ☔ View full report in Codecov by Sentry. |
@@ -2,5 +2,5 @@ import { Injectable } from '@angular/core'; | |||
|
|||
@Injectable({ providedIn: 'root' }) | |||
export class UrlValidationService { | |||
urlRegex = /^(?:http(s)?:\/\/)?[\w.-]+(?:\.[\w.-]+)+[\w\-._~:/?#[\]@!$&'()*+,;=.]+$/; | |||
urlRegex = /^(https?|ftp|mqtt|ws|wss):\/\/([a-zA-Z0-9.-]+)(:[0-9]+)?(\/.*)?$/; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we update regexp to match whatever://anything
?
This still won't allow for some URLs.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we update regexp to match
whatever://anything
? This still won't allow for some URLs.
I'll check. In this case it's really a wild card 😃
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I updated it + tests.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍🏼
This PR has been merged and conversations have been locked. |
Testing: see ticket.
Result, no validation error: