i18next / i18next-http-backend

i18next-http-backend is a backend layer for i18next using in Node.js, in the browser and for Deno.
MIT License
447 stars 69 forks source link

Fix for method override in requestOptions not working #130

Closed rijk closed 8 months ago

rijk commented 8 months ago

While implementing an Airtable based backend, I discovered that overriding the HTTP method (in this case to PATCH to do an upsert) is not working as it should, even though the documentation explicitly mentions this example:

image

.

To test, use config: requestOptions: { method: 'PATCH' }. Before this fix, any saveMissing or updateMissing calls would still have method: POST.

I believe the issue is an incorrect use of defaults(), where the default values are put first in the parameter list, while it appears the function expects them to be the last (although, it is an unclear signature).

adrai commented 8 months ago

thank you, it's included in v2.4.3

rijk commented 8 months ago

Awesome, super quick!