getsandbox / worker-cli

Sandbox Worker is the core processing component of the Sandbox product
https://getsandbox.com
230 stars 62 forks source link

support for gzip requests #34

Closed stringy05 closed 5 years ago

stringy05 commented 5 years ago

Sandbox doesn't support compressed requests, which is causing me grief.

It would be great if this worked:

$ echo '{"name" : "brock"}' | gzip | curl -v  --data-binary @- localhost:8080/users -H 'Content-Encoding: gzip'

>> HTTP POST /users  (Matched route '/users')
>> Headers: {Accept=*/*, Content-Encoding=gzip, Content-Length=39, Content-Type=application/x-www-form-urlencoded, Host=localhost:8080, User-Agent=curl/7.54.0}
>> Body: '?�\�V�K�MUR�RPJ*�O�V��7*�' (39 bytes)
the body is: [{?�\�V�K�MUR�RPJ*�O�V��7*�=}]
<< Status: 200 (took 0ms)
<< Headers: {Access-Control-Allow-Origin=*, Access-Control-Allow-Methods=GET,POST,PUT,DELETE,PATCH,OPTIONS, Access-Control-Allow-Credentials=true, Access-Control-Allow-Headers=Content-Type, Content-Type=application/json}
<< Body: '{   "status": "ok" }'
stringy05 commented 5 years ago

opened PR #35