Commit Graph

1304 Commits

Author SHA1 Message Date
Erik Dubbelboer d71fc6c2c0 Ignore *.fasthttp.br files from tests 2020-11-02 22:21:43 +01:00
Maxim Korolyov 9697ccb834 Added httpproxy v2 (#889)
* httpproxy v2 with improved auth barrier storage and full https proxy support

* fixed package name

* moved back the env proxy
2020-10-29 21:05:59 +01:00
Mohammad Alian 9ed328c168 remove unnecessary type conversion (#890)
Co-authored-by: Mohammad Alian <ts-mohammad.alian@rakuten.com>
2020-10-29 20:53:41 +01:00
Maxim Korolyov 4eac1ae470 Added proxy from env support (#885)
* added proxy from env support

* fixed package name

* fixed err wrapping

* evoid 2 err wrapping in the same format
2020-10-25 14:46:54 +01:00
Vitali Pikulik 56775f4d9f tryDial timeout (#881)
* Change tryDial to handle timeout correctly

* fasthttpproxy/http.go accepts timeout

* Fix example doc

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

* Improve import in httpproxy

* Simplify tryDial

* Cleanup

* Wait for concurrencyCh

Co-authored-by: Erik Dubbelboer <erik@dubbelboer.com>
2020-10-03 09:44:36 +02:00
hex0x00 805af0ee73 Brotli support in FS handler. (#880)
* Add files via upload

* Update fs.go

* Add files via upload

* Update fs_test.go
2020-09-28 17:14:28 +02:00
Erik Dubbelboer ae8b65fa62 Add Client.CloseIdleConnections() 2020-09-13 13:58:13 +02:00
Vitali Pikulik aa3f96c883 Git commit fix URI parse for urls like host.dm?some/path/to/file (#866) 2020-08-21 16:21:23 +02:00
Erik Dubbelboer 434c48ba7e Travis doesn't seem to support tip anymore v1.16.0 2020-08-16 11:35:22 +02:00
Erik Dubbelboer 12aba62b7b Change CI to use Go 1.15 2020-08-16 10:52:49 +02:00
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