webmetrics / browsermob-proxy

NOTICE: this project has been forked and is being maintained at https://github.com/lightbody/browsermob-proxy
https://github.com/lightbody/browsermob-proxy
Apache License 2.0
234 stars 773 forks source link

Blacklist: custom status codes cannot be configured using REST #28

Open acdha opened 12 years ago

acdha commented 12 years ago

I wanted to test front-end handling of server failures but it appears that as of the current HEAD this feature cannot be completely configured using the REST interface - note the HTTP status below:

$ curl -X POST -d port=9091 http://localhost:8080/proxy
{"port":9091}
$ curl -X PUT -d 'regex=^.*/api/v1/.*$' -d status=503 http://localhost:8080/proxy/9091/blacklist
$ curl -si --proxy 127.0.0.1:9091 'http://127.0.0.1:8000/en/api/v1/…'
HTTP/1.1 200 OK
Date: Thu, 05 Jan 2012 16:18:06 GMT
Server: Jetty/5.1.x (Mac OS X/10.7.2 x86_64 java/1.6.0_29
Content-Type: text/plain
Content-Length: 0

This does provide a good place for me to test my handling of empty responses, though