headzoo / surf

Stateful programmatic web browsing in Go.
MIT License
1.48k stars 159 forks source link

Status not checked #134

Open frioux opened 2 years ago

frioux commented 2 years ago

I wrote some code to do a request and was surprised when the body was empty. After some digging I found that the code that actually does an HTTP request never checks the status code, so if the upstream server returns a 500 (or whatever) all you get is an empty response. I would be happy to submit a PR that surfaces an error when the status is >= 400.