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

fix(core): Improve domain and url matching for extractDomain and extractUrl #6010

Merged
merged 4 commits into from
Apr 20, 2023

Conversation

OlegIvaniv
Copy link
Contributor

@OlegIvaniv OlegIvaniv commented Apr 19, 2023

This PR includes updates to the regexes used for URL and domain matching to ensure that we handle various edge cases, such as URLs with queries or hashes, localhosts, and URLs with ports. Additionally, I've added documentation that explains the updated regex and included additional test cases to test these edge cases.

Github issue / Community forum post (link here to close automatically):

…input

# Please enter a commit message to explain why this merge is necessary,
# especially if it merges an updated upstream into a topic branch.
#
# Lines starting with '#' will be ignored, and an empty message aborts
# the commit.
@OlegIvaniv OlegIvaniv self-assigned this Apr 19, 2023
@github-actions
Copy link
Contributor

github-actions bot commented Apr 19, 2023

Great PR! Please pay attention to the following items before merging:

Files matching packages/**:

  • If fixing bug, added test to cover scenario.
  • If addressing forum or Github issue, added link to description.

Files matching packages/**/*.ts:

  • Added unit tests to cover new or updated functionality.

Make sure to check off this list before asking for review.

@n8n-assistant n8n-assistant bot added core Enhancement outside /nodes-base and /editor-ui n8n team Authored by the n8n team labels Apr 19, 2023
@codecov
Copy link

codecov bot commented Apr 19, 2023

Codecov Report

Patch coverage: 100.00% and project coverage change: +0.01 🎉

Comparison is base (cd89489) 18.49% compared to head (dcfe5a4) 18.50%.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #6010      +/-   ##
==========================================
+ Coverage   18.49%   18.50%   +0.01%     
==========================================
  Files        2563     2563              
  Lines      116018   116021       +3     
  Branches    18118    18122       +4     
==========================================
+ Hits        21458    21474      +16     
+ Misses      93930    93917      -13     
  Partials      630      630              
Impacted Files Coverage Δ
...ckages/workflow/src/Extensions/StringExtensions.ts 75.00% <100.00%> (+2.15%) ⬆️

... and 5 files with indirect coverage changes

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report in Codecov by Sentry.
📢 Do you have feedback about the report comment? Let us know in this issue.

@github-actions
Copy link
Contributor

✅ All Cypress E2E specs passed

@OlegIvaniv OlegIvaniv merged commit 33fb732 into master Apr 20, 2023
@OlegIvaniv OlegIvaniv deleted the ado-476-bug-extractdomain-breaks-when-the-input branch April 20, 2023 07:01
OlegIvaniv added a commit that referenced this pull request Apr 21, 2023
MiloradFilipovic added a commit that referenced this pull request Apr 21, 2023
* master: (199 commits)
  feat(editor): Add disable template experiment (#5963)
  feat(core): Upgrade google-timezones-json to use the correct timezone for Sao Paulo (#6042)
  fix(Code Node): Update vm2 to address CVE-2023-30547 (#6039)
  docs: Add proprietary license text (no-changelog) (#6038)
  test(n8n Node): Unit tests (no-changelog)
  refactor: Accumulate `loadOptions` from all node versions to validate (no-changelog) (#6014)
  Update CHANGELOG.md
  feat: Add variables e2e tests (no-changelog) (#6027)
  fix(editor): Fix typo in SSO upgrade link (#6031)
  fix(editor): Add correct add variable button message when no variables created (no-changelog) (#6028)
  docs: Add api notice to credentials for google sheets nodes (no-changelog) (#6024)
  fix(Notion Node): Update credential test to not require user permissions (#6022)
  fix(editor): Clean up demo and template callouts from workflows page (#6023)
  fix(editor): Fix memory leak in Node Detail View by correctly unsubscribing from event buses (#6021)
  fix(editor): SettingsSidebar should disconnect from push when navigating away (#6025)
  fix(editor): Use fake timers in useDebounce.test.ts to make the test less flaky (no-changelog) (#6029)
  docs: Update the info URL for updating n8n (no-changelog) (#6018)
  fix(core): Improve domain and url matching for extractDomain and extractUrl (#6010)
  feat(core): Add SSH key generation (#6006)
  fix(editor): Update SSO upgrade link (#6016)
  ...

# Conflicts:
#	packages/editor-ui/src/components/WorkflowShareModal.ee.vue
#	packages/editor-ui/src/stores/workflows.ts
#	packages/editor-ui/src/views/NodeView.vue
sunilrr pushed a commit to fl-g6/qp-n8n that referenced this pull request Apr 24, 2023
…actUrl (n8n-io#6010)

* fix(core): Fix domain and url matching for isDomain/isUrl/extractDomain/extractUrl

* Document regex and include www in the domain

* Lint fix
@janober
Copy link
Member

janober commented May 2, 2023

Got released with [email protected]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
core Enhancement outside /nodes-base and /editor-ui n8n team Authored by the n8n team Released
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants