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

(only ios safari) Axios only send options while add Authorization at (interceptors/request/config) #2920

Closed
stewForAni opened this issue Apr 22, 2020 · 10 comments

Comments

@stewForAni
Copy link

only happen on ios safari
ios: 13.4
axios: 0.19.2

when i do post api ,only send options but no post ;
But it works when i delete (config.headers.Authorization = VueCookies.get('token')) at (interceptors/request/config)

@jasonsaayman
Copy link
Member

Hi Stew,

Please can you use the issue templates provided when creating an issue, as well as provide some code examples?

@stewForAni
Copy link
Author

stewForAni commented Apr 23, 2020

Hi Stew,

Please can you use the issue templates provided when creating an issue, as well as provide some code examples?

Hi,jasonsaayman. When i do post api,i only found potions but no post and can not get the response.
And it works when i delete "Authorization" setting. (only happen on ios safari / ios: 13.4 / axios: 0.19.2) The code like these:

////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
const Axios = axios.create({
baseURL: Common.base_url,
timeout: 5000,
responseType: 'json',
})

Axios.interceptors.request.use(
config => {
if (config.method === 'post') {
config.data = qs.stringify(config.data)
}
// if (VueCookies.isKey("token")) {
// config.headers.Authorization = VueCookies.get('token')
// }
return config
},
error => {
return Promise.reject(error.data.error.message)
}
)
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

@chinesedfan
Copy link
Collaborator

We suggest users ask similar questions in stackoverflow, instead of Github issues. In fact, you can learn almost everything about CORS from MDN. Search for OPTIONS.

@stewForAni
Copy link
Author

We suggest users ask similar questions in stackoverflow, instead of Github issues. In fact, you can learn almost everything about CORS from MDN. Search for OPTIONS.

这是axios和safari兼容性问题,不找axios提问还能找谁?而且这个问题确实存在,只发生在ios的safari。你不帮忙解答就算了,还让我这个小白去 stackoverflow浪费时间嘛?我的chinese哥

@jasonsaayman
Copy link
Member

Hi Stew,

This seems to be similar to #2751, can you have a look? If so then there is a long discussion going on in that issue about how to solve this problem. Also try moving back to 0.19.0 and see if what you are trying works with 0.19.0.

Thanks

@jasonsaayman
Copy link
Member

jasonsaayman commented Apr 23, 2020

@stewForAni I am going to close for now as I think it will be more appropriate to work on #2751 and keep all comments aggregated over there.

@stewForAni
Copy link
Author

Hi Stew,

This seems to be similar to #2751, can you have a look? If so then there is a long discussion going on in that issue about how to solve this problem. Also try moving back to 0.19.0 and see if what you are trying works with 0.19.0.

Thanks

sorry,0.19.0 also not work

@stewForAni
Copy link
Author

@stewForAni I am going to close for now as I think it will be more appropriate to work on #2571 and keep all comments aggregated over there.

cool man, 2751 or 2571 ???

@jasonsaayman
Copy link
Member

Sorry man slipped up while typing #2751

@stewForAni
Copy link
Author

Sorry man slipped up while typing #2751

cool man, Can we chat with some app? Im from China. I will send you some image to show the bug.

@axios axios locked and limited conversation to collaborators May 22, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants