Skip to content

Commit 533d3d9

Browse files
committed
chore: Upgrade axios, as there was a security issue, they fixed the url behavior
1 parent c958a54 commit 533d3d9

File tree

4 files changed

+12
-23
lines changed

4 files changed

+12
-23
lines changed

package-lock.json

+7-7
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@
4141
"axios": ">= 0.17.0"
4242
},
4343
"devDependencies": {
44-
"axios": "^1.7.3",
44+
"axios": "^1.7.4",
4545
"chai": "^4.3.6",
4646
"eslint": "^9.8.0",
4747
"mocha": "^10.7.0",

test/pass_through.spec.js

+2-8
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
const axios = require("axios");
2-
const isLegacyAxios = require("axios/package.json").version[0] === "0";
32
const expect = require("chai").expect;
43
const createServer = require("http").createServer;
54

@@ -107,7 +106,7 @@ describe("passThrough tests (requires Node)", function () {
107106

108107
it("handles baseURL correctly", function () {
109108
instance = axios.create({
110-
baseURL: "/test",
109+
baseURL: "http://localhost/test",
111110
proxy: {
112111
host: "127.0.0.1",
113112
port: httpServer.address().port,
@@ -118,12 +117,7 @@ describe("passThrough tests (requires Node)", function () {
118117
mock.onAny().passThrough();
119118
return instance.get("/foo").then(function (response) {
120119
expect(response.status).to.equal(200);
121-
122-
if (isLegacyAxios) {
123-
expect(response.data).to.equal("http://null/test/foo");
124-
} else {
125-
expect(response.data).to.equal("http://localhost/test/foo");
126-
}
120+
expect(response.data).to.equal("http://localhost/test/foo");
127121
});
128122
});
129123

test/pass_through_on_no_match.spec.js

+2-7
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
const axios = require("axios");
2-
const isLegacyAxios = require("axios/package.json").version[0] === "0";
32
const expect = require("chai").expect;
43
const createServer = require("http").createServer;
54

@@ -113,7 +112,7 @@ describe("onNoMatch=passthrough option tests (requires Node)", function () {
113112

114113
it("handles baseURL correctly", function () {
115114
instance = axios.create({
116-
baseURL: "/test",
115+
baseURL: "http://localhost/test",
117116
proxy: {
118117
host: "127.0.0.1",
119118
port: httpServer.address().port,
@@ -123,11 +122,7 @@ describe("onNoMatch=passthrough option tests (requires Node)", function () {
123122

124123
return instance.get("/foo").then(function (response) {
125124
expect(response.status).to.equal(200);
126-
if (isLegacyAxios) {
127-
expect(response.data).to.equal("http://null/test/foo");
128-
} else {
129-
expect(response.data).to.equal("http://localhost/test/foo");
130-
}
125+
expect(response.data).to.equal("http://localhost/test/foo");
131126
});
132127
});
133128

0 commit comments

Comments
 (0)