axios-mock-adapter icon indicating copy to clipboard operation
axios-mock-adapter copied to clipboard

Support for loose request headers validation

Open earllapura opened this issue 6 years ago • 1 comments

The package already has validation for request headers. However, it checks for request headers in a strict manner:

function isEqual(a, b) {
  return deepEqual(a, b, { strict: true });
}
// ...
function isRequestHeadersMatching(requestHeaders, required) {
  if (required === undefined) return true;
  return isEqual(requestHeaders, required);
}

Is there any way to make it loose like having a configuration to allow contains or some operation equivalent to that? Thank you!

earllapura avatar Jan 23 '19 03:01 earllapura

Additionally, it would be nice if there was some documentation and code examples around request headers to make it clear how we should consume it.

andrewnottaviano avatar Aug 01 '19 16:08 andrewnottaviano