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
452 stars 70 forks source link

Fix for method override in requestOptions not working #130

Closed rijk closed 9 months ago

rijk commented 9 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 9 months ago

thank you, it's included in v2.4.3

rijk commented 9 months ago

Awesome, super quick!