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

@uppy/utils: do not strip www in getSocketHost #5621

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

Murderlon
Copy link
Member

Closes #5606

@Murderlon Murderlon self-assigned this Jan 23, 2025
Copy link
Contributor

Diff output files
diff --git a/packages/@uppy/utils/lib/getSocketHost.js b/packages/@uppy/utils/lib/getSocketHost.js
index eff22e4..3479427 100644
--- a/packages/@uppy/utils/lib/getSocketHost.js
+++ b/packages/@uppy/utils/lib/getSocketHost.js
@@ -1,6 +1,6 @@
 export default function getSocketHost(url) {
   var _regex$exec;
-  const regex = /^(?:https?:\/\/|\/\/)?(?:[^@\n]+@)?(?:www\.)?([^\n]+)/i;
+  const regex = /^(?:https?:\/\/|\/\/)?(?:[^@\n]+@)?([^\n]+)/i;
   const host = (_regex$exec = regex.exec(url)) == null ? void 0 : _regex$exec[1];
   const socketProtocol = /^http:\/\//i.test(url) ? "ws" : "wss";
   return `${socketProtocol}://${host}`;

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

Successfully merging this pull request may close these issues.

Function to get socket host is removing www
1 participant