nuxt-community / axios-module

Secure and easy axios integration for Nuxt 2
https://axios.nuxtjs.org
MIT License
1.19k stars 247 forks source link

method spoofing is not working #370

Open sergeevpasha opened 4 years ago

sergeevpasha commented 4 years ago

const formData = new FormData() formData.append('_method', 'PATCH') formData.append('signature', data.signatureFile, data.signatureName) $axios .$post(/v1/users/1, formData, { headers: { "Content-Type": "multipart/form-data" } })

The same example works fine in vue + axios, but it's not working in nuxt + nuxt-axios-module

farnabaz commented 3 years ago

Hey, Sorry for the late response.
Did you manage to find the root cause of the issue?

sergeevpasha commented 3 years ago

@farnabaz Barely remember, but seems like I change from $axios.$post to $axios.post and that helped

farnabaz commented 3 years ago

Thank you for the response, I think this should be fix in the latest, because module does not add any logic to these functions. And the result should be same in latest version. https://github.com/nuxt-community/axios-module/blob/main/lib/plugin.js#L45-L47