contactlab / saray

:warning: This project is no longer mantained - 'Yet Another Rest API Stubber'.split(' ').reverse().map(item => item[0].toLowerCase()).join('')
Apache License 2.0
13 stars 7 forks source link

Bad response status code when stubb not found #91

Open StefanoMagrassi opened 7 years ago

StefanoMagrassi commented 7 years ago

When a stubb for the provided method isn't found Saray should not set response status code 404.

See https://github.com/contactlab/saray/blob/master/src/index.js#L211

StefanoMagrassi commented 7 years ago

The error happens when there is a "preflight" request and the "dynamic path" case is not controlled.

In order to replicate the bug, you can try to make a fetch request to a stubb with a dynamic path, setting a custom header in the init optional object (see MDN/fetch)