-
Notifications
You must be signed in to change notification settings - Fork 6.5k
Open
Description
In the file cors-anywhere.js the code var location = parseURL(req.url.slice(1))
have some problem.
When I send an axios request
const proxyUrl = 'http://127.0.0.1:38000/'; // my cors-anywhere server
const targetUrl = 'http://localhost:38080/api/v5/configs/broker';
axios
.get(proxyUrl + targetUrl, {
auth: {
username: username,
password: password,
},
headers: {
'Content-Type': 'application/json',
},
})
.then((response) => {
console.log(response.data)
})
.catch((error) => {
console.log(error)
})
})
The value of this req.url.slice(1)
is http://localhost:38080/api/v5/configs/broker
When I send an other axios request
const proxyUrl = 'http://5c62ur.natappfree.cc/scros/';
const targetUrl = 'http://5c62ur.natappfree.cc/mqtt/api/v5/configs/trace';
axios
.get(proxyUrl + targetUrl, {
auth: {
username: username,
password: password,
},
headers: {
'Content-Type': 'application/json',
},
})
.then((response) => {
console.log(response.data)
})
.catch((error) => {
console.log(error)
})
})
The value of this req.url.slice(1)
is http:/5c62ur.natappfree.cc/mqtt/api/v5/configs/broker
,There is a /
missing after http:
Metadata
Metadata
Assignees
Labels
No labels