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

[releases/6.3.z] WINDUP-4139:axios upgrade to 0.28.0 (#975) #982

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions ui-pf4/src/main/webapp/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
"@types/websocket": "^1.0.5",
"@types/yup": "0.29.6",
"antd": "4.7.0",
"axios": "0.21.4",
"axios": "^0.28.0",
"axios-mock-adapter": "^1.21.2",
"enzyme": "^3.11.0",
"enzyme-adapter-react-16": "^1.15.7",
Expand Down Expand Up @@ -66,7 +66,8 @@
"@types/react": "^16.9.49",
"follow-redirects": "^1.15.6",
"semver": "^7.5.4",
"tough-cookie": "^4.1.3"
"tough-cookie": "^4.1.3",
"axios": "^0.28.0"
},
"scripts": {
"start": "react-scripts start",
Expand Down
1 change: 1 addition & 0 deletions ui-pf4/src/main/webapp/src/api/apiInit.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ export const initInterceptors = (getToken: () => Promise<string>) => {
axios.interceptors.request.use(
async (config) => {
const token = await getToken();
if (!config.headers) config.headers = {};
if (token) config.headers["Authorization"] = "Bearer " + token;
return config;
},
Expand Down
4 changes: 2 additions & 2 deletions ui-pf4/src/main/webapp/src/store/alert/actions.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ export const alertFetchEndpoint = (err: AxiosError) => {
if (err.response && err.response.data) {
if (typeof err.response.data === "string") {
errorDescription = err.response.data;
} else if (err.response.data.error) {
errorDescription = err.response.data.error;
} else if ((err.response.data as any).error) {
errorDescription = (err.response.data as any).error;
}
}
return (dispatch: Dispatch) => {
Expand Down
4 changes: 2 additions & 2 deletions ui-pf4/src/main/webapp/src/utils/modelUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -149,8 +149,8 @@ export const getErrorsFromLabelProviderEntity = (

// Axios error
export const getAxiosErrorMessage = (axiosError: AxiosError) => {
if (axiosError.response?.data.message) {
return axiosError.response?.data.message;
if ((axiosError.response?.data as any).message) {
return (axiosError.response?.data as any).message;
}
return axiosError.message;
};
35 changes: 22 additions & 13 deletions ui-pf4/src/main/webapp/yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -3503,19 +3503,14 @@ axios-mock-adapter@^1.21.2:
fast-deep-equal "^3.1.3"
is-buffer "^2.0.5"

axios@0.21.4:
version "0.21.4"
resolved "https://registry.yarnpkg.com/axios/-/axios-0.21.4.tgz#c67b90dc0568e5c1cf2b0b858c43ba28e2eda575"
integrity sha512-ut5vewkiu8jjGBdqpM44XxjuCjq9LAKeHVmoVfHVzy8eHgxxq8SbAVQNovDA8mVi05kP0Ea/n/UzcSHcTJQfNg==
axios@^0.19.0, axios@^0.28.0:
version "0.28.1"
resolved "https://registry.yarnpkg.com/axios/-/axios-0.28.1.tgz#2a7bcd34a3837b71ee1a5ca3762214b86b703e70"
integrity sha512-iUcGA5a7p0mVb4Gm/sy+FSECNkPFT4y7wt6OM/CDpO/OnNCvSs3PoMG8ibrC9jRoGYU0gUK5pXVC4NPXq6lHRQ==
dependencies:
follow-redirects "^1.14.0"

axios@^0.19.0:
version "0.19.2"
resolved "https://registry.yarnpkg.com/axios/-/axios-0.19.2.tgz#3ea36c5d8818d0d5f8a8a97a6d36b86cdc00cb27"
integrity sha512-fjgm5MvRHLhx+osE2xoekY70AhARk3a6hkN+3Io1jc00jtquGvxYlKlsFUhmUET0V5te6CcZI7lcv2Ym61mjHA==
dependencies:
follow-redirects "1.5.10"
follow-redirects "^1.15.0"
form-data "^4.0.0"
proxy-from-env "^1.1.0"

axobject-query@^2.2.0:
version "2.2.0"
Expand Down Expand Up @@ -6042,7 +6037,7 @@ [email protected]:
dependencies:
tabbable "^5.3.2"

follow-redirects@1.5.10, follow-redirects@^1.0.0, follow-redirects@^1.14.0, follow-redirects@^1.15.6:
follow-redirects@^1.0.0, follow-redirects@^1.15.0, follow-redirects@^1.15.6:
version "1.15.6"
resolved "https://registry.yarnpkg.com/follow-redirects/-/follow-redirects-1.15.6.tgz#7f815c0cda4249c74ff09e95ef97c23b5fd0399b"
integrity sha512-wWN62YITEaOpSK584EZXJafH1AGpO8RVgElfkuXbTOrPX4fIfOyEpW/CsiNd8JdYrAoOvafRTOEnvsO++qCqFA==
Expand Down Expand Up @@ -6092,6 +6087,15 @@ form-data@^3.0.0:
combined-stream "^1.0.8"
mime-types "^2.1.12"

form-data@^4.0.0:
version "4.0.0"
resolved "https://registry.yarnpkg.com/form-data/-/form-data-4.0.0.tgz#93919daeaf361ee529584b9b31664dc12c9fa452"
integrity sha512-ETEklSGi5t0QMZuiXoA/Q6vcnxcLQP5vdugSpuAyi6SVGi2clPPp+xgEhuMaHC+zGgn31Kd235W35f7Hykkaww==
dependencies:
asynckit "^0.4.0"
combined-stream "^1.0.8"
mime-types "^2.1.12"

form-data@~2.3.2:
version "2.3.3"
resolved "https://registry.yarnpkg.com/form-data/-/form-data-2.3.3.tgz#dcce52c05f644f298c6a7ab936bd724ceffbf3a6"
Expand Down Expand Up @@ -10269,6 +10273,11 @@ proxy-addr@~2.0.7:
forwarded "0.2.0"
ipaddr.js "1.9.1"

proxy-from-env@^1.1.0:
version "1.1.0"
resolved "https://registry.yarnpkg.com/proxy-from-env/-/proxy-from-env-1.1.0.tgz#e102f16ca355424865755d2c9e8ea4f24d58c3e2"
integrity sha512-D+zkORCbA9f1tdWRK0RaCR3GPv50cMxcrz4X8k5LTSUD1Dkw47mKJEZQNunItRTkWwgtaUSo1RVFRIG9ZXiFYg==

psl@^1.1.33:
version "1.9.0"
resolved "https://registry.yarnpkg.com/psl/-/psl-1.9.0.tgz#d0df2a137f00794565fcaf3b2c00cd09f8d5a5a7"
Expand Down
Loading