Commit Graph

1066 Commits

Author SHA1 Message Date
Erik Dubbelboer d4f0cf56d8 Remove fasthttp.ByteBuffer
As advertised in https://github.com/valyala/fasthttp/commit/b5f96d4b4120bb1e09c23ac32baf21a14da4a71d
2018-10-01 14:15:29 +08:00
bslizon 761788a34b Add tcp keepalive 2018-09-27 15:22:58 +03:00
bslizon 2e04bb8884 enable TCP keep-alives 2018-09-27 15:22:58 +03:00
Erik Dubbelboer be257bcef6 Improve Shutdown behaviour 2018-09-27 17:38:34 +08:00
Erik Dubbelboer 7ec2b18772 Remove race condition from test 2018-09-24 22:46:21 +08:00
Erik Dubbelboer b3b6b8cb28 Fix Request.connectionCloseFast bugs
See https://github.com/valyala/fasthttp/pull/265
and https://github.com/valyala/fasthttp/issues/220
and https://github.com/valyala/fasthttp/issues/264
2018-09-24 21:30:30 +08:00
Erik Dubbelboer 3d4ce5b57c Fix data race errors
Server.Shutdown was causing data race errors. One issue was that it was
possible for sync.WaitGroup.Add() to be called while Shutdown was already
calling .Wait(). To fix this I have removed the WaitGroup and replaced
it with atomic counters and a semi busy wait loop.

Fixes #416
2018-09-24 21:22:40 +08:00
Erik Dubbelboer 1ba43613e8 Clarify how to do relative redirects
Fixes #328
2018-09-20 18:06:11 +08:00
Erik Dubbelboer b5f96d4b41 WARNING: fasthttp.ByteBuffer will be removed! 2018-09-20 16:21:42 +08:00
Erik Dubbelboer c67f81e5f9 Use PostArgs in client
See: https://github.com/erikdubbelboer/fasthttp/issues/17
2018-09-20 15:22:18 +08:00
Erik Dubbelboer d53df67945 Fix Content-Type bug in FS
Fixes #417
2018-09-20 11:36:07 +08:00
David Byttow da9ba61e3b Allows for empty content type by default. Fixes #214 2018-09-19 01:28:32 +03:00
Emir Beganović 351f874e5e Fix small typo in readme 2018-09-17 14:42:35 +08:00
Oleg Kovalov 10a0540dfc Remove redundant else statements 2018-09-14 10:00:13 +08:00
Erik Dubbelboer 869903cf7a Fix Cookie peek
See: https://github.com/valyala/fasthttp/issues/313
2018-09-13 12:42:54 +08:00
Erik Dubbelboer 761869f3f8 Close the file before trying to rename in SaveMultipartFile
On Windows systems it is not possible to rename files that are opened.
2018-09-13 12:39:45 +08:00
Erik Dubbelboer 4d08c11c11 Remove RequestHeader.isGet
This small optimization is not worth the extra code complexity.
2018-09-13 12:36:16 +08:00
Jerry Jacobs 6025a4a41c Allow overwrite of ContentType by caller of RequestCtx.ServeFile 2018-09-13 12:27:17 +08:00
David Byttow dbc9965d33 Adds support for max-age cookie value. Fixes #184 (#412)
Adds support for max-age cookie value
2018-09-13 12:19:38 +08:00
Iskander Sharipov 5c41b44ca7 use proper "Deprecated" comment format
Found using https://go-critic.github.io/overview#deprecatedComment-ref
2018-09-11 22:29:16 +03:00
Erik Dubbelboer 7796335d5f Do case insensitive comparisons for headers and cookies 2018-09-11 20:07:09 +03:00
Erik Dubbelboer c6fd90e432 Don't suppresses TLS related errors
See https://github.com/valyala/fasthttp/issues/300
2018-09-05 20:07:23 +03:00
Erik Dubbelboer 50bdd6c77c Fix appendQuotedPath to include all allowed characters 2018-09-05 20:06:18 +03:00
Erik Dubbelboer 7529e6b2e5 Add SOCKS5 dialer
See: https://github.com/valyala/fasthttp/issues/161
2018-09-05 19:58:53 +03:00
Erik Dubbelboer d7688109a5 Reset all fields when releasing a clientConn
This fixes a bug where a previous read deadline timer would be reused
for a new connection preventing Client.ReadTimeout from working
properly.

See: https://github.com/valyala/fasthttp/pull/259
2018-09-01 13:20:36 +08:00
Jan Siemiński 6231e237de Add ';' to unescaped characters 2018-09-01 13:00:11 +08:00
Erik Dubbelboer 5f6439b6df Remove wrong documentation 2018-08-31 14:22:05 +08:00
Xu Qiaolun ecb7cbdfb2 call the ConnState callbacks in Server.ServeConn 2018-08-30 15:20:32 +00:00
Xu Qiaolun c88d0992b4 vendor ConnState type in fasthttp package 2018-08-30 15:20:32 +00:00
徐乔伦 71b7e99093 fix test case error 2018-08-30 15:20:32 +00:00
徐乔伦 69613e6feb add support for http.ConnState
issue #205
2018-08-30 15:20:32 +00:00
Erik Dubbelboer 373357d2d4 Try the same formats as net/http for cookie expire
See: https://github.com/golang/go/blob/00379be17e63a5b75b3237819392d2dc3b313a27/src/net/http/cookie.go#L133-L135

Fixes #175
2018-08-29 22:55:21 +08:00
michael.kochegarov 19d2d06ab5 Configuration for automatic retry for idempotent calls 2018-08-29 22:26:04 +08:00
Erik Dubbelboer 2cc8e6be6d go fmt ./... 2018-08-29 20:26:12 +08:00
Kirill Danshin 57b1f46d15 Update LICENSE 2018-08-28 19:55:09 +00:00
Kirill Danshin 0821f75aea Update README.md 2018-08-27 22:23:26 +00:00
Erik Dubbelboer d3181922e1 Fix connsCleaner sleep time
Fixes: https://github.com/valyala/fasthttp/issues/308
2018-08-27 21:49:31 +00:00
Erik Dubbelboer b174f54b12 Add method to get cookie from response 2018-08-27 21:46:32 +00:00
Erik Dubbelboer 7c74b1f431 Remove duplicate check
Is already checked at https://github.com/valyala/fasthttp/blob/4a16377d6e780cb75b91962ea2100d83f7452565/http.go#L1190
and https://github.com/valyala/fasthttp/blob/4a16377d6e780cb75b91962ea2100d83f7452565/http.go#L1244
2018-08-27 21:46:12 +00:00
Erik Dubbelboer 26aa8e51e8 Allow whitespace after chunk size
There seems to be servers/load balancers that insert whitespaces
between the chunk-size number and \r\n.
2018-08-27 21:42:46 +00:00
Erik Dubbelboer e277e51b15 Add support for ResponseHeader.Peek("Set-Cookie")
See: https://github.com/erikdubbelboer/fasthttp/issues/4
2018-08-27 21:42:16 +00:00
Erik Dubbelboer d689bfcde7 Copy file if rename fails (save multipart)
Renaming a file can fail when the two files are on different devices.
Just copy if rename fails for any reason. If rename fails because of
other reaons copy will either work or fail for the same reason as well
so we won't miss any errors after this.
2018-08-27 21:35:30 +00:00
Erik Dubbelboer 6c79939960 Fix Get/Post documentation
The functions don't append to dst, they overwrite.
2018-08-27 21:30:43 +00:00
Erik Dubbelboer fbf4b2d9cd Do not log ErrSmallBuffer for request headers
fasthttp returns a 431 error when the request headers are too large.
Most other HTTP servers do not log an error when the request header
exceeds the limit. When serving HTTP requests directly to browsers,
it is normal to occasionally hit the limit due to broken browsers
or broken sites linking to your resource. These issues are generally
outside of your control in the same way the already ignored errors are.
2018-08-27 21:30:11 +00:00
Sergio Andres Virviescas Santana 77385190fb Added atreugo micro-framework in README 2018-08-27 08:55:21 +00:00
Erik Dubbelboer 5b46f8ddc5 Added support for multiple TLS domains
See: https://github.com/erikdubbelboer/fasthttp/pull/24
2018-08-25 20:11:58 +03:00
Erik Dubbelboer 9b72466ae0 Stop random TestServerErrSmallBuffer failures
TestServerErrSmallBuffer had a small race condition where the test would
checkout the output of the logger after the client connection had been
served but before the worker had written the result to the logger.

This new code is also much faster as it doesn't actually use TCP but
just some in memory buffers.
2018-08-25 16:57:27 +03:00
Erik Dubbelboer d84d8ea604 Allow removal of the Server header in responses
his PR adds an option to the Server called `NoDefaultServerHeader` that
allows a user to indicate that neither the Server's `Name` field nor
the `defaultServerName` should be included in the Server's responses
as a `Server` header by default.

Now when `ResponseHeader.AppendBytes` is found to have an empty `server`
field, it simply skips the `Server` header. Previously that method
would write the `defaultServerName` when no value was found. The only
code paths that took advantage of that were ones originating from
`writeErrorResponse`, which now handles setting the server name
directly.

Fixes: https://github.com/valyala/fasthttp/issues/221
2018-08-25 16:00:48 +03:00
Kirill Danshin 4b420745b9 Merge branch 'master' of github.com:valyala/fasthttp 2018-08-25 02:15:25 +03:00
Kirill Danshin c661e13a56 .travis.yml: add 1.11 support, not droping 1.9.x just yet
Signed-off-by: Kirill Danshin <k@guava.by>
2018-08-25 02:13:16 +03:00