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

`--pfer-api` fails when the API is not reachable #66

Closed LasaleFamine closed 7 years ago

LasaleFamine commented 7 years ago

If the API is not reachable (like an API behind a proxy...) Saray become unreachable too.

pferretti commented 7 years ago

I'm trying to reproduce the bug so I'm explaining what I've discovered by now with @LasaleFamine. It seems that the failure happens when the address configured as endpoint is unreachable and the endpoint itself doesn't respond immediately but it leaves the http request pending. In this way, Saray also remains pending and the failure occurs.

Probably it would be a good idea to let Saray handle a timeout and respond with an HTTP 408 if a timeout occurs.