Remove old copy of server.go and use the library

The fork of the http server used in the router was missing a fair number
of upstream updates and didn't seem to add additional logic or
capability to the router.  Given the recent issue with 204's it seems
like a good idea to revert to the golang library's net/http
implementation.
Use NATSClient interface
Add EmitError to mockEmitter

Adheres to Emitter interface in loggregatorlib:
 https://github.com/cloudfoundry/loggregatorlib/commit/b02c84bd8b7e8ad3658e264cae02e2fd16d29e99

Signed-off-by: Zach Robinson <zrobinson@pivotallabs.com>
Change router.register log message to Debug

I think notifying logging of a router register should be a debug level message not info.

* Frequent router register log messages make it very hard to follow router logs when diagnosing an issue.
* We are sending all our CF logs to our Enterprise Splunk.  Splunk charges by the MB sent to splunk.  So par router.register messages are accounting for 75% of our log messages.
symmetry between router.unregister and router.register log msgs

Signed-off-by: Glenn Oppegard <goppegard@pivotallabs.com>
Request the undecoded path on the backend server to avoid double
decoding.

[#61230066]

Signed-off-by: Phan Le <ple@pivotallabs.com>
Fixed bug where query string would show up twice

[finishes #61230066]
Signed-off-by: Phan Le <ple@pivotallabs.com>
Fix flakey test when using yagnats

Signed-off-by: Phan Le <ple@pivotallabs.com>
Revert "Remove old copy of server.go and use the library"

This reverts commit 4b179726f973891061b79ea76ac17bd9de0d04ec.

[#62818290] The commit we are reverting removed modifications to our
custom copy of net/http/server.go from the Go 1.0.3 standard library,
including changes in 1a8c32646473bbba29e00e08690444a649d80f42 that were
apparently designed to "[m]ake response independent of [the] request". We are
changing back to the modified version in an attempt to prevent frequent
gorouter crashes.

Signed-off-by: Abhijit Hiremagalur <abhi@pivotallabs.com>
updated license and notice files
Remove unused types in our fork of server.go

[#62920758]

Signed-off-by: Abhijit Hiremagalur <abhi@pivotallabs.com>
Move server.go into its own package

To make it easier to see dependencies into the code we forked from net/http

[#62920758]

Signed-off-by: Eric Malm <emalm@pivotallabs.com>
Remove file that was introduced accidentally

Signed-off-by: Abhijit Hiremagalur <abhi@pivotallabs.com>
Make router tests pass locally

[#62920758]

Signed-off-by: Eric Malm <emalm@pivotallabs.com>
Copied net/http/serve_test.go as server_test.go

With modifications so it compiles. It does not pass yet

Signed-off-by: Abhijit Hiremagalur <abhi@pivotallabs.com>
Run proxy/server_test.go against built-in net/http

Most tests pass, compiles correctly against net/http

[#62920758]

Signed-off-by: Abhijit Hiremagalur <abhi@pivotallabs.com>
Move server_test.go alongside server/server.go

Signed-off-by: Abhijit Hiremagalur <abhi@pivotallabs.com>
Copy library net/http/httptest/server.go and switch it to our server/server.go

[#62920758]

Signed-off-by: Eric Malm <emalm@pivotallabs.com>
Remove irrelevant tests against server.go

Also remove errors duplicated from standard library net/http.

[#62920758]

Signed-off-by: Phan Le <ple@pivotallabs.com>
Remove TODOs copied from standard library server.go

[finishes #62920758]

Signed-off-by: Eric Malm <emalm@pivotallabs.com>