Closed bendvc closed 6 years ago
Looks really great! Only thing is, I kinda hate the name allowHttpPut
, because we're always going to have methods called putCart
or whatever, and they are always going to be "allowed". Could we rename the flag to overrideHttpPut
? Users can then probably imagine that would correspond to a commonly-used "x-method-override" header, too.
Looking pretty good.
One thing we might want to do is add some documentation around this flag, maybe here: https://github.com/mobify/commercecloud-ocapi-client#-configuration
(I agree with Oli, word 'override' sounds more intuitive in this case)
I've addressed both of your comments. This involved inverting the logic a little as the name change is the inverse. Please take a look
Description
This change added a new option to the api.
overrideHttpPut
which is defaulted tofalse
that will ensure all commands that using httpPUT
as specified in their swagger doc will masquerade as httpPOST
. Their http method will then be overridden with an additional headerx-dw-http-method-override: 'PUT'
to ensure things work server side.This was done on the API side for security reasons, so it is out of our hands. More information about this can be found here --> https://documentation.demandware.com/DOC1/index.jsp?topic=%2Fcom.demandware.dochelp%2FOCAPI%2F18.8%2Fusage%2FHttpMethods.html
Type of change
Changes
How to test this PR?
Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce. Please also list any relevant details for your test configuration
Checklist:
npm run lint
)README.md
andCHANGELOG.md
)npm test
)