Commit Graph

46 Commits

Author SHA1 Message Date
Aliaksandr Valialkin 910e5a9d2a Added FormFile and FormValue helpers to RequestCtx in order to be on par with net/http 2016-01-08 15:03:02 +02:00
Aliaksandr Valialkin a175504c5f improved 'connection: close' server tests 2016-01-08 13:52:28 +02:00
Aliaksandr Valialkin c5d9023043 Issue #30: properly handle content-length for HEAD responses 2016-01-05 18:02:50 +02:00
Aliaksandr Valialkin 7f5b710e05 Issue #31: do not send response body for HEAD requests 2016-01-05 16:53:38 +02:00
Aliaksandr Valialkin 84af73053f Added tests for RequestCtx.*UserValue* functions 2016-01-05 15:59:33 +02:00
Aliaksandr Valialkin 3284c3e671 Pull request #24: added support for '100 Continue' responses and 'Expect: 100-continue' requests. Kudos to @celer 2015-12-25 16:11:20 +02:00
Aliaksandr Valialkin 149f0f38b7 Issue #14: added CompressHandler wrapper for transparent response compression support 2015-12-25 13:33:01 +02:00
Aliaksandr Valialkin e4c3007338 Improved RequestCtx.WriteString() test 2015-12-24 20:54:17 +02:00
Aliaksandr Valialkin 38473d3cf1 Issue #20: Added TimeoutErrorWithResponse helper function to RequestCtx 2015-12-17 12:25:53 +02:00
Aliaksandr Valialkin 3ab54e2452 Issue #20: Added TimeoutErrorWithCode helper function to RequestCtx 2015-12-16 21:13:59 +02:00
Aliaksandr Valialkin 71e8c28a95 Issue #16: properly set 'Connection' response header 2015-12-10 11:47:25 +02:00
Aliaksandr Valialkin 9c18f79145 Added support for If-Modified-Since to SendFile and FS 2015-12-09 18:51:51 +02:00
Aliaksandr Valialkin 52999aff94 Added SetBodyStreamWriter for streaming response body 2015-12-09 16:33:07 +02:00
Aliaksandr Valialkin 9bac0d4123 Added RequestCtx.SendFile() 2015-12-08 15:18:21 +02:00
Aliaksandr Valialkin 4cf82252e3 Added ability to filter out non-GET requests 2015-11-29 12:49:01 +02:00
Aliaksandr Valialkin 145fa563c6 Removed flackiness from Logger tests by skipping request duration 2015-11-28 20:45:02 +02:00
Aliaksandr Valialkin 9e35210a5a Fixed possible data race on RequestCtx.TimeoutError if connection's buffered reader is attached to ctx.fbr 2015-11-24 16:56:29 +02:00
Aliaksandr Valialkin 45ed911251 Improved RequestCtx.Hijack() - now HijackHandler works with the real net.Conn instead of fake io.ReadWriter. Also reduced memory usage by releasing empty read buffers on hijacked connections 2015-11-24 13:55:00 +02:00
Aliaksandr Valialkin 146145240d Added RequestCtx.Hijack() for connections' hijacking 2015-11-23 19:41:43 +02:00
Aliaksandr Valialkin a81d93c2ae Added ability to limit keep-alive connection lifetime 2015-11-23 14:17:49 +02:00
Aliaksandr Valialkin a8bfab03d8 API prettifying: ServeConnTime -> ConnTime, ServeConnRequestNum -> ConnRequestNum 2015-11-22 01:29:42 +02:00
Aliaksandr Valialkin 954a0615dc Fixed a typo in RequestCtx.SetConnectionClose() 2015-11-19 11:51:04 +02:00
Aliaksandr Valialkin a2601c68af API consistency change - make Response.StatusCode accessor 2015-11-19 11:39:20 +02:00
Aliaksandr Valialkin 86fe38c7a2 Hide Respone and Request body behind Body accessors 2015-11-18 14:00:24 +02:00
Aliaksandr Valialkin f3b4ff17b1 Added accessors for determining ServeConn call start time and the sequence number of request served in the connection 2015-11-17 16:29:14 +02:00
Aliaksandr Valialkin 2dbf142a06 convert connectionClose to accessor 2015-11-16 18:23:08 +02:00
Aliaksandr Valialkin c728643d4a Access Content-Length via ContentLength accessor 2015-11-16 18:09:05 +02:00
Aliaksandr Valialkin f1f78f0828 Hide Request.URI and Request.PostArgs behind accessors, which automatically call parse URI and PostArgs on first access 2015-11-15 23:47:22 +02:00
Aliaksandr Valialkin 88e41d9b08 Removed accessors converting []byte to string, i.e. allocating memory. This should reduce memory usage for apps using fasthttp, since now they shoud either use []byte or do string() conversion on their own :) 2015-11-14 18:25:00 +02:00
Aliaksandr Valialkin 2e78d83bf7 Hide Request.RequestURI behind accessors in order to prevent users shooting in the foot when assigning to Request.RequestURI directly 2015-11-14 17:58:58 +02:00
Aliaksandr Valialkin 1f81c87c38 Substituted direct access to Request.Method by accessors, so package users don't shoot in the foot when assigning directly to Request.Method 2015-11-14 17:34:12 +02:00
Aliaksandr Valialkin 3f0794bcd1 Added RequestCtx.LocalAddr() for determining server address for the current connection 2015-11-12 21:50:44 +02:00
Aliaksandr Valialkin 69758b81d6 Accept net.Conn instead of io.ReadWriteCloser in Serve*() methods, since in reality we use net.Conn methods such as RemoteAddr, SetReadDeadline and SetWriteDeadline 2015-11-11 16:17:12 +02:00
Aliaksandr Valialkin a0ee798bbe Added RequestCtx.Init() helper for custom Server implementations 2015-11-09 18:41:27 +02:00
Aliaksandr Valialkin 3aa2987131 Substituted RequestCtx.shadow with more clear timeoutErrMsg 2015-11-09 11:03:50 +02:00
Aliaksandr Valialkin 5a6e973ab3 Log request duration in RequextCtx.Logger() 2015-11-06 16:21:49 +02:00
Aliaksandr Valialkin a7fdc68be0 Enforce MaxConnsPerIP limit to connections served via Server.ServeConn() 2015-11-05 10:56:04 +02:00
Aliaksandr Valialkin 27862cc299 Fixed data races in Request.ReadTimeout() and Response.ReadTimeout(). Documented that the request and response instances cannot be used after ErrReadTimeout error 2015-10-26 14:13:33 +02:00
Aliaksandr Valialkin 40e775dce5 Added TimeoutHandler 2015-10-23 14:56:01 +03:00
Aliaksandr Valialkin 9a1e1f2e61 Renamed ServerCtx to more appropriate RequestCtx 2015-10-22 11:46:33 +03:00
Aliaksandr Valialkin d0deaebb43 Added request start time to ServerCtx 2015-10-21 16:09:35 +03:00
Aliaksandr Valialkin 45d00cad56 Fixed broken test 2015-10-21 16:06:15 +03:00
Aliaksandr Valialkin 37cb5a0c67 Added status codes from net/http 2015-10-21 16:02:53 +03:00
Aliaksandr Valialkin d49d752a65 Substituted racy ServerCtx.Steal() with ServerCtx.TimeoutError() 2015-10-21 15:05:44 +03:00
Aliaksandr Valialkin ee62382f34 Uniformly process all headers 2015-10-20 12:36:33 +03:00
Aliaksandr Valialkin a049630bca initial commit 2015-10-19 01:21:09 +03:00