smollweide / node-mock-server

File based Node REST API mock server
MIT License
255 stars 65 forks source link

HTTP code does work with response header #149

Closed ngoccuong291 closed 4 years ago

ngoccuong291 commented 4 years ago

When I tried to setup a mock response with custom HTTP code (i.e: 302) and a custom header (Location=https://www.google.com), the header did not get sent back along with the response and the http code did not come neither. If I setup the same response header with the standard success.json (HTTP code 200) then it works fine. After playing with different header, looks like the header "Location" was the problem, when I chose something else (i.e: my-custom-header), it worked fine

smollweide commented 4 years ago

Hi @ngoccuong291, did you checked out the documentation here? https://github.com/smollweide/node-mock-server/blob/master/doc/readme-response-header.md

There are two ways of defining headers.