testinggospels / camouflage

Camouflage is a backend mocking tool for HTTP, gRPC, Websockets and Thrift protocols, which helps you carry out your front end prototyping, unit testing, functional/performance testing in silos, in absence of one or more Microservices/APIs.
https://testinggospels.github.io/camouflage/
MIT License
270 stars 26 forks source link

Error: Can't set headers after they are sent when using file handlebar in docker container #249

Open jimpanzeeee opened 6 months ago

jimpanzeeee commented 6 months ago

Describe the bug When using file handlebar with docker camouflage a "Error: Can't set headers after they are sent" occurs instead of the file being served.

To Reproduce Steps to reproduce the behavior:

  1. Mock File Content
    
    HTTP/1.1 200 OK
    Content-Type: image/png

{{file path="./files/mr_man.png"}}

2. Folder Structure `camouflage/mocks/aws/s3/student-plans/GET.mock`
3. Error Stack Trace

camouflage | Error: Can't set headers after they are sent. camouflage | at SendStream.headersAlreadySent (/usr/local/lib/node_modules/camouflage-server/node_modules/send/index.js:386:13) camouflage | at SendStream.send (/usr/local/lib/node_modules/camouflage-server/node_modules/send/index.js:613:10) camouflage | at onstat (/usr/local/lib/node_modules/camouflage-server/node_modules/send/index.js:725:10) camouflage | at FSReqCallback.oncomplete (node:fs:199:5)



**Expected behavior**
The file is served.

**Screenshots**
N/A

**Desktop (please complete the following information):**
 - OS: [macOS Ventura 13.3]
 - Browser [Using postman not a browser]
 - Version [Not sure what version I am meant to put here]

**Additional context**
Attach camouflage.log file
jimpanzeeee commented 6 months ago

Ah I can see this has been fixed already, but maybe there hasn't been a docker image update with the same fix?

jimpanzeeee commented 6 months ago

Yep - version in docker container is

/app # camouflage --version
0.12.0

Could we get a docker image update please?