fix: request endpoint heading (#3804)
This commit is contained in:
@@ -395,17 +395,14 @@ const newSendRequest = async () => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const ensureMethodInEndpoint = () => {
|
const ensureMethodInEndpoint = () => {
|
||||||
if (
|
const endpoint = newEndpoint.value.trim()
|
||||||
!/^http[s]?:\/\//.test(newEndpoint.value) &&
|
tab.value.document.request.endpoint = endpoint
|
||||||
!newEndpoint.value.startsWith("<<")
|
if (!/^http[s]?:\/\//.test(endpoint) && !endpoint.startsWith("<<")) {
|
||||||
) {
|
const domain = endpoint.split(/[/:#?]+/)[0]
|
||||||
const domain = newEndpoint.value.split(/[/:#?]+/)[0]
|
|
||||||
if (domain === "localhost" || /([0-9]+\.)*[0-9]/.test(domain)) {
|
if (domain === "localhost" || /([0-9]+\.)*[0-9]/.test(domain)) {
|
||||||
tab.value.document.request.endpoint =
|
tab.value.document.request.endpoint = "http://" + endpoint
|
||||||
"http://" + tab.value.document.request.endpoint
|
|
||||||
} else {
|
} else {
|
||||||
tab.value.document.request.endpoint =
|
tab.value.document.request.endpoint = "https://" + endpoint
|
||||||
"https://" + tab.value.document.request.endpoint
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user