mirror of
https://github.com/farcasclaudiu/Flowise.git
synced 2026-06-28 17:01:00 +03:00
Fix: Ensure normalizeURL retains port number (#3959)
* fix: Preserve port in normalizeURL function The normalizeURL function was previously ignoring the port in the URL. This fix explicitly includes the port if present (e.g., `:3000`). * fix lint problem fix lint problem
This commit is contained in:
committed by
GitHub
parent
8d327e465c
commit
e1ea1c68d1
@@ -378,7 +378,8 @@ function getURLsFromHTML(htmlBody: string, baseURL: string): string[] {
|
|||||||
*/
|
*/
|
||||||
function normalizeURL(urlString: string): string {
|
function normalizeURL(urlString: string): string {
|
||||||
const urlObj = new URL(urlString)
|
const urlObj = new URL(urlString)
|
||||||
const hostPath = urlObj.hostname + urlObj.pathname + urlObj.search
|
const port = urlObj.port ? `:${urlObj.port}` : ''
|
||||||
|
const hostPath = urlObj.hostname + port + urlObj.pathname + urlObj.search
|
||||||
if (hostPath.length > 0 && hostPath.slice(-1) == '/') {
|
if (hostPath.length > 0 && hostPath.slice(-1) == '/') {
|
||||||
// handling trailing slash
|
// handling trailing slash
|
||||||
return hostPath.slice(0, -1)
|
return hostPath.slice(0, -1)
|
||||||
|
|||||||
Reference in New Issue
Block a user