Commit Graph

1294 Commits

Author SHA1 Message Date
Erik Dubbelboer 01acd76daf Allow TimeoutHandler connections to be kept alive (#864) 2020-08-16 09:21:00 +02:00
Erik Dubbelboer a995d43d9c Add EnableNormalizing to RequestHeader and ResponseHeader 2020-08-16 09:18:05 +02:00
sky cc8ba4b5a3 Add a api DisableNoDefaultContentType to disable add default content type. (#859)
* Add api DisableNoDefaultContentType to disable add default contentype if no Content-Type header.

* Update test case.

* Update api name.

* Update header.go

Co-authored-by: Erik Dubbelboer <erik@dubbelboer.com>

Co-authored-by: Erik Dubbelboer <erik@dubbelboer.com>
2020-08-07 17:38:59 +02:00
kiyon 2509c12e77 improve statusLine and StatusMessage by using slice instead of map (#855)
* 🚀 improve statusLine and StatusMessage by using slice instead of map

Co-authored-by: Fenny <fenny@gofiber.io>
Co-authored-by: ReneWerner87 <rene@gofiber.io>

* for cli stuff

* make invalidStatusLine() just return the formatted line

* for ci stuff

Co-authored-by: Fenny <fenny@gofiber.io>
Co-authored-by: ReneWerner87 <rene@gofiber.io>
2020-08-02 19:18:57 +02:00
So-chiru a7c7ef2367 Fix comment typo 2020-08-02 12:33:42 +02:00
Erik Dubbelboer 34a61fe63f Update linting (#851) 2020-07-17 14:22:28 +02:00
Erik Dubbelboer 4cffe1a510 Use a directory we are sure to exist for tests v1.15.1 2020-07-15 11:29:34 +02:00
Erik Dubbelboer 607743cb8e Ignore gosec warning in example v1.15.0 2020-07-12 18:25:46 +02:00
Erik Dubbelboer f97a382d80 Add letsencrypt example 2020-07-11 20:40:19 +02:00
Serge Romanov e6ed19fd0c update link to router package (#842)
Co-authored-by: Bob Cohn <robert.cohn@taotesting.com>
2020-06-25 10:34:24 +02:00
Erik Dubbelboer ef51a7e590 Fix fasthttpadaptor Content-Type detection
Make this in line with how net/http handles Content-Type.
2020-06-21 11:09:08 +02:00
Erik Dubbelboer ac4cc171a5 Completely remove fuzzit
They have been acquired by GitLab and are going to remove all data for
previous projects. See https://github.com/valyala/fasthttp/issues/838
2020-06-21 10:55:27 +02:00
Nagy Salem 38affcb146 Added Gearbox (#823) 2020-06-18 22:44:33 +02:00
Erik Dubbelboer 9dd7979b2e Restart PipelineClient worker on error (#834) 2020-06-16 11:58:07 +02:00
Erik Dubbelboer 380f00bfdb Fixed bug which prevents cached FS files from being updated
Bug was introduced in previous "Fixed recompressing of stale files"
commit.
2020-06-12 21:47:32 +02:00
Erik Dubbelboer 2f28edba01 Fixed recompressing of stale files 2020-06-07 11:54:40 +02:00
Erik Dubbelboer 1671faf0bd Prefork does work on windows
Just need to use Reuseport.
2020-06-07 11:19:31 +02:00
Erik Dubbelboer cc9db3ab20 Try TravisCI Windows (#828)
* Try TravisCI Windows

* prefork is supported on windows with Reuseport=true

* Bit longer timeouts for tests
2020-06-06 15:57:38 +02:00
sky ac51d598dc Make the ErrNothingRead to be exposed. (#827)
* Make the ErrNothingRead to be exposed.

* Update header.go

update annotation.

Co-authored-by: Erik Dubbelboer <erik@dubbelboer.com>
2020-06-05 14:12:33 +02:00
RW 853abb31af 🐞 panic in fs.go #824 (#825)
Co-authored-by: wernerr <rene.werner@verivox.com>
2020-06-04 16:53:47 +02:00
Andy Pan 33b3cb259e Support Windows SO_REUSEADDR (#822)
* Support Windows SO_REUSEADDR

* Update the comment

* Renew comment of the Listen method on Windows
2020-06-04 16:51:39 +02:00
Andy Pan 29e6d094c8 Update TechEmpower benchmark from 18 to 19 round (#821) 2020-06-02 11:56:48 +02:00
Erik Dubbelboer b98999e8e0 Merge pull request #820 from valyala/uri-errors
URI.Parse now returns an error
v1.14.0
2020-06-01 11:46:14 +02:00
Erik Dubbelboer 439185eb57 Run cross compilation and race detector on the latest release only 2020-05-31 17:05:49 +02:00
Erik Dubbelboer bcaa594b41 Remove unused raw header code 2020-05-31 15:49:37 +02:00
Erik Dubbelboer 9468c66e25 URI.Parse now returns an error 2020-05-31 15:16:54 +02:00
Erik Dubbelboer 1391312294 Merge pull request #817 from vural/custom-retry-decider
Add custom retry decider for fail http requests
2020-05-30 16:50:17 +02:00
Vural Kap 77dcda39ae Add custom retry decider for fail http requests 2020-05-27 20:40:04 +03:00
Erik Dubbelboer 2f92c68a07 Add timeouts to tls Handshake
Fixes #813 which suggested the code.
v1.13.0 v1.13.1
2020-05-25 20:44:04 +02:00
Erik Dubbelboer 123f6a8cee Fix memory reusage bug with auth
Fixes #814
2020-05-25 20:27:15 +02:00
Erik Dubbelboer 24410e58c0 Merge pull request #810 from valyala/brotli
Add Brotli support
2020-05-18 18:30:48 +02:00
Erik Dubbelboer d22782d3f7 HostClient can't switch between protocols (#800) 2020-05-18 18:30:29 +02:00
Moritz Marquardt 5bd1b0cf2c Make FS return a redirect for directories without trailing slash (#802)
* Make FS return a redirect for directories without trailing slash

Fixes #792

* Add a test for the directory redirect

* Fix directory redirects for ServeFile

* Fix error message

Co-authored-by: Erik Dubbelboer <erik@dubbelboer.com>
2020-05-18 18:30:13 +02:00
Erik Dubbelboer 05d4602a68 Fix race condition in test 2020-05-16 11:54:57 +02:00
Erik Dubbelboer 339ad36634 Add Brotli support
New Functions:

    CompressHandlerBrotliLevel(h RequestHandler, brotliLevel, otherLevel int) RequestHandler
    Request.BodyUnbrotli() ([]byte, error)
    Response.BodyUnbrotli() ([]byte, error)
    AppendBrotliBytesLevel(dst, src []byte, level int) []byte
    WriteBrotliLevel(w io.Writer, p []byte, level int) (int, error)
    WriteBrotli(w io.Writer, p []byte) (int, error)
    AppendBrotliBytes(dst, src []byte) []byte
    WriteUnbrotli(w io.Writer, p []byte) (int, error)
    AppendUnbrotliBytes(dst, src []byte) ([]byte, error)

New Constants:

    CompressBrotliNoCompression
    CompressBrotliBestSpeed
    CompressBrotliBestCompression
    CompressBrotliDefaultCompression

Brotli compression levels are different from gzip/flate. Because of this we have separate level constants and CompressHandlerBrotliLevel takes 2 levels.

I didn't add Brotli support to CompressHandler as this could cause a spike in CPU usage when users upgrade fasthttp.

fasthttp.CompressBrotliDefaultCompression is not the same as
brotli.DefaultCompression. brotli.DefaultCompression is more than twice
as slow as fasthttp.CompressBrotliDefaultCompression which I thought was
unreasonable as default.
2020-05-15 15:36:26 +02:00
Erik Dubbelboer 9507d7c7d7 Don't wrap conn with a TLS Client if it's already a TLS Conn 2020-05-12 12:32:53 +02:00
Erik Dubbelboer dacd0353f9 HostClient can't switch between protocols 2020-05-02 21:01:52 +02:00
Julian Junxiang Zhou dc6b9db734 Copy to the req.Header.userAgent from the defaultUserAgent (#796)
This avoids the req.Header.userAgent sharing an underlying array with the
global defaultUserAgent

This should fix the #795
2020-04-30 13:06:48 +02:00
Mike MacDermaid 32940977fb allow the expect 100 continue workflow to deny requests (#787)
* allow the expect 100 continue workflow to deny requests

* suggested changes

* update booleans to reflect handler name change
2020-04-27 20:29:02 +02:00
Erik Dubbelboer 446e1a638d Fix .travis.yml 2020-04-26 14:58:14 +02:00
Erik Dubbelboer 079f39bddc Don't allow ASCII control character in URLs (#790)
* Don't allow ASCII control character in URLs

* Add tests
2020-04-25 20:54:59 +02:00
Ivan Mironov 3e27d8ebad Fix integer overflow handling in parseUintBuf() (#789)
* Add more tests for parseUintBuf()

* Fix integer overflow handling in parseUintBuf()
2020-04-23 15:08:07 +02:00
Erik Dubbelboer 571315f30a Only base64 the proxy auth once 2020-04-23 15:05:56 +02:00
Erik Dubbelboer 503e363eb4 Remove unnecessary check
Fixes #785
2020-04-21 09:17:34 +02:00
Erik Dubbelboer 54df169029 Add fasthttpproxy.FasthttpHTTPDialer v1.12.0 2020-04-20 18:32:19 +02:00
Erik Dubbelboer 96a8ad6e00 Upgrade dependencies 2020-04-20 18:21:58 +02:00
Kirill Danshin 5ce12a8e78 oss-security got new email
Signed-off-by: Kirill Danshin <kirill@danshin.pro>
2020-04-19 03:12:28 +03:00
Kirill Danshin f9ef8fc47b update the docs
Signed-off-by: Kirill Danshin <kirill@danshin.pro>
v1.11.0
2020-04-19 00:44:47 +03:00
Kirill Danshin cc407796cd fix: s.concurrency stays 0 when you don't use s.ServeConn
Signed-off-by: Kirill Danshin <kirill@danshin.pro>
2020-04-19 00:44:47 +03:00
Markmerc db18810c87 Add configuration to not pre-parse multipart form data (#778)
Co-authored-by: Mercurio <mmmercur@amazon.com>
v1.10.0
2020-04-14 18:17:57 +02:00