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

NAS-134061 / 25.10 / Apps - UI validates uri type more strictly than middleware #11530

Merged
merged 4 commits into from
Feb 13, 2025

Conversation

AlexKarpov98
Copy link
Contributor

Testing: see ticket.

Result, no validation error:

Screenshot 2025-02-10 at 13 41 21

@AlexKarpov98 AlexKarpov98 added the backport-25.04-RC.1 Fangtooth RC1 label Feb 10, 2025
@AlexKarpov98 AlexKarpov98 self-assigned this Feb 10, 2025
@AlexKarpov98 AlexKarpov98 requested a review from a team as a code owner February 10, 2025 12:21
@AlexKarpov98 AlexKarpov98 requested review from RehanY147 and removed request for a team February 10, 2025 12:21
@bugclerk
Copy link
Contributor

@bugclerk bugclerk changed the title NAS-134061: Apps - UI validates uri type more strictly than middleware NAS-134061 / 25.10 / Apps - UI validates uri type more strictly than middleware Feb 10, 2025
Copy link

codecov bot commented Feb 10, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 83.27%. Comparing base (b93bfe9) to head (1377f8f).
Report is 2 commits behind head on master.

✅ 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.
📢 Have feedback on the report? Share it here.

@@ -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]+)?(\/.*)?$/;
Copy link
Collaborator

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.

Copy link
Contributor Author

@AlexKarpov98 AlexKarpov98 Feb 12, 2025

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 😃

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I updated it + tests.

@AlexKarpov98 AlexKarpov98 requested a review from undsoft February 12, 2025 15:02
Copy link
Collaborator

@undsoft undsoft left a comment

Choose a reason for hiding this comment

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

👍🏼

@bugclerk
Copy link
Contributor

This PR has been merged and conversations have been locked.
If you would like to discuss more about this issue please use our forums or raise a Jira ticket.

@truenas truenas locked as resolved and limited conversation to collaborators Feb 13, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants