ctimmerm / axios-mock-adapter

Axios adapter that allows to easily mock requests
MIT License
3.47k stars 245 forks source link

headers filtering is too strict #219

Closed skyboyer closed 4 years ago

skyboyer commented 5 years ago

Headers validation has been implemented in #70 to make such a thing:

mock.onPatch('/someHandler', undefined, { "X-CSRF": "mockedToken" }).reply(200)

But by now we have to specify all the headers not just few we want to focus on. It's because isRequestHeadersMatching finally uses deepEqual to find appropriate handler.

Is it intentional for any reason? If no, I'd like to send a patch.

PS Also see no docs on headers filtering at main page. Is it also intentional for any reason(like API has not stabilized yet and still may change or kind of that)? If no, I'd like to help on that too.

skyboyer commented 5 years ago

seems it duplicates #214