Commit Graph

26 Commits

Author SHA1 Message Date
Matthew Holt
2a46f2a14e Revert recent Content-Length-related changes and fix fastcgi return
fastcgi's ServeHTTP method originally returned the correct value (0) in
b51e8bc191. Later, I mistakenly suggested
we change that to return the status code because I forgot that status
codes aren't logged by the return value. So fastcgi broke due in
3966936bd6 due to my error.

We later had to try to make up for this with ugly Content-Length checks
like in c37ad7f677. Turns out that all we
had to do was fix the returned status here back to 0. The proxy
middleware behaves the same way, and returning 0 is correct. We should
only return a status code if the response has not been written, but with
upstream servers, we do write a response; they do not know about our
error handler.

Also clarifed this in the middleware.Handler documentation.
2016-03-02 11:33:40 -07:00
Matthew Holt
cae9f7de9c gofmt -s; fix misspellings and lint; Go 1.5.3 in Travis CI 2016-02-14 00:10:57 -07:00
Matthew Holt
d227bec0ff Move common function into existing file 2015-10-29 10:34:47 -06:00
Zac Bergquist
e158cda057 Fix test failures on Windows.
Most of the Windows test failures are due to the path separator not being "/".  The general approach I took here was to keep paths in "URL form" (ie using "/" separators) as much as possible, and only convert to native paths when we attempt to open a file.  This will allow the most consistency between different host OS.  For example, data structures that store paths still store them with "/" delimiters.  Functions that accepted paths as input and return them as outputs still use "/".

There are still a few test failures that need to be sorted out.

- config/setup/TestRoot (I hear this has already been fixed by someone else)
- middleware/basicauth/TestBrowseTemplate and middleware/templates/Test (a line endings issue that I'm still working through)
2015-10-13 19:49:53 -04:00
Matthew Holt
47717fee88 Expanded index file support to other middlewares (fixes #27) 2015-05-05 15:50:42 -06:00
Matthew Holt
085f6e9560 Keepin' the comments true 2015-05-04 13:42:39 -06:00
Matthew Holt
20118bdfd2 Clearing out the old stuff 2015-05-04 13:40:07 -06:00
Matthew Holt
c7af6725ca Removed Host() and Port() functions from Controller
I don't think they'll be necessary; can get same info from request Host header
2015-04-15 23:17:28 -06:00
Matthew Holt
d33256f1dc Refactor: Middleware chain uses Handler instead of HandlerFunc 2015-04-02 23:30:54 -06:00
Matthew Holt
29fec4742e Detailed godoc; better error handling convention 2015-03-29 22:01:42 -06:00
Matthew Holt
4e9c432c14 Controller/Dispenser refactoring, typo fixes 2015-03-29 19:56:19 -06:00
Matthew Holt
9378f38371 Major refactoring for better error handling 2015-03-28 16:37:37 -06:00
Matthew Holt
da72a5fbcd Controller can register functions to run at shutdown 2015-03-26 23:22:48 -06:00
Matthew Holt
5d4726446d Finished dispenser tests 2015-03-21 14:36:32 -06:00
Matthew Holt
010ac23e8a More tests! 2015-03-21 11:18:37 -06:00
Matthew Holt
35225fe2d3 Docs and comments, la la 2015-03-20 18:11:54 -06:00
Matthew Holt
af56c5033c New method to get remaining arguments on a line 2015-03-16 11:23:17 -06:00
Matthew Holt
974acbf38c Partial support for location contexts in config files 2015-03-03 09:49:01 -07:00
Matthew Holt
ac7f50b4cd Updated doc comment 2015-01-29 22:14:31 -07:00
Matthew Holt
612d77eaab Moved Path type around 2015-01-29 22:08:40 -07:00
Matthew Holt
fe62afd3d9 Beginning to move middleware into their own packages 2015-01-29 22:02:17 -07:00
Matthew Holt
dca59d0eda Stubbed out really basic proxy middleware 2015-01-29 17:18:14 -07:00
Matthew Holt
a38a2a0e4f Created basic fastcgi middleware layer 2015-01-21 17:51:47 -07:00
Matthew Holt
decfda2705 Made parsing easier in middleware 2015-01-21 12:09:49 -07:00
Matthew Holt
24fc2ae59e Major refactoring; more modular middleware 2015-01-18 23:11:21 -07:00
Matthew Holt
4497a16fb0 Early prototype; initial commit 2015-01-13 12:43:45 -07:00