Age | Commit message (Collapse) | Author | Files | Lines |
|
* fix: propagate body stream error to close function (#1743)
* fix: http test
* fix: close body stream with error in encoding functions
* fix: lint
---------
Co-authored-by: Max Denushev <denushev@tochka.com>
|
|
|
|
|
|
|
|
Require that HTTP versions match the following pattern: HTTP/[0-9]\.[0-9]
|
|
This is required for https://github.com/google/oss-fuzz/pull/11453
|
|
|
|
|
|
|
|
|
|
compile time (#1607)
|
|
- don't limit it to 32 bits
- give it a proper name
- don't over-allocate too much
|
|
|
|
|
|
|
|
|
|
|
|
* feat: support response body stream
* style: add header interface
* Update http.go
Co-authored-by: Erik Dubbelboer <erik@dubbelboer.com>
* feat: support request、response、client stream
* fix: close reader bug
---------
Co-authored-by: fanhaodong.516 <fanhaodong.516@bytedance.com>
Co-authored-by: Erik Dubbelboer <erik@dubbelboer.com>
|
|
|
|
* Refactor golangci-lint config
- Use golangci-lint-action for GitHub workflow.
- Add additional golangci-lint run options.
- Remove unused nolint directives.
* Revert exclude-use-default option
|
|
|
|
|
|
Co-authored-by: root <nikesh.tawde@digitalairtech.com>
|
|
1. the length of trailer key should > 0
2. fix http_test words typo
|
|
* fix: ignore body should not set content-length of streaming https://github.com/valyala/fasthttp/pull/1022
* fix: add commit
|
|
* Dropping support for 1.15.
* Replaces Go 1.16 Deprecated functions
* Update test build flag
* Fix import sort and comment
* Update github.com/klauspost/compress to v1.15.9
https://github.com/klauspost/compress improved performance and changed Minimum version is 1.16, this should be the final supported release for Go 1.16 (https://github.com/klauspost/compress/commit/6d0019a95afa3221f7522d1f2eed0033b5e79470) .
|
|
|
|
* header.go ContentEncoding() getter and setters
For Response the CE header is stored into a separate field because compressed responses are often used.
But for the Request let's just peek and store it from headers map
* http.go: New BodyUncompressed() method for request and responses
The new method returns a body and uncompress if it's gzipped
|
|
Header.SetCanonical() (#1311)
* Response.ContentEncoding(): store as field
The CE is not so often used for plain APIs responses and even not so often used for static files and on the fly compression.
But still it should be checked each time.
Also having a dedicated field getter and setter simplifies code
* header.go Use shorter Response.setNonSpecial() and Request.setNonSpecial() methods instead of SetCanonical()
The change should improve performance because the setSpecialHeader() call is omitted.
As a downside on adding a new basic header field all putHeader() must be replaced with a direct getter and setter.
|
|
Mostly in tests.
|
|
|
|
* Fix UseHostHeader for DoTimeout + tests
* Release UseHostHeader in ReleaseRequest() + tests
|
|
|
|
* Allow to set Host header for Client
* Allow to change Host header without tests violation
* Rename AllowToChangeHostHeader and add tests.
* Allow to use empty uri.Host() when req.Header.Host() does not empty
|
|
|
|
|
|
|
|
* Add trailer support
* fix issue and add documentation
* remove redundant code
* add error return for add/set trailer method
* fix lint error
* fix bad trailer error return issue and update bad content-length error
* update errNonNumericChars
* update errNonNumericChars
* fix issue about error and fix typo
|
|
Currently, the only way to set URI for a request is to call SetRequestURI(string).
Then when a request performed the string will be parsed into a fasthttp.URI struct.
If there are many requests with the same URI then we'll waste CPU for a parsing of the same URI string.
With the new SetURI(*URI) method we can once parse a URI string into a fasthttp.URI struct and then reuse it for many requests.
Unfortunately the URI will be copied because may be modified inside the request.
But anyway this will be more lightweight than parsing.
|
|
* Adding zero-allocation uint64 to byte slice conversion and fixing the ResponseHeader.SetStatusLine function call signature
* Removing unnecessary i2b function
* Fixing various bugs
* Adding test cases
* Commenting AppendStatusLine
* Update status.go
Co-authored-by: Erik Dubbelboer <erik@dubbelboer.com>
* Update header.go
Co-authored-by: Erik Dubbelboer <erik@dubbelboer.com>
* Cleaning up references to strHTTP11, using formatStatusLine for invalidStatusLine, and making `appendStatusLine` an unexported function
Issue: https://github.com/valyala/fasthttp/issues/1132
* Fixing merge conflicts
Issue: https://github.com/valyala/fasthttp/issues/1132
* Replacing []byte{} with nil in some test cases
Issue: https://github.com/valyala/fasthttp/issues/1132
* Cleaning up parsing first line, and improving StatusMessage function
Issue: https://github.com/valyala/fasthttp/issues/1132
* Fixing as per PR
* Update header.go
Co-authored-by: Erik Dubbelboer <erik@dubbelboer.com>
* Update header.go
Co-authored-by: Erik Dubbelboer <erik@dubbelboer.com>
* Fixing as per requested changes
* Update header_test.go
Co-authored-by: Erik Dubbelboer <erik@dubbelboer.com>
Co-authored-by: Erik Dubbelboer <erik@dubbelboer.com>
|
|
* SetStatusMessage
* Docstring
* statusLine in header
* Use statusLine as []byte + ResponseHeader parsing
* status line getter
|
|
|
|
* Fix ignore body should not set content-length
* Add TestRequestReadNoBody
Co-authored-by: liuchenxing <liuchenxing@bytedance.com>
|
|
|
|
Don't default to chunked. If we have a Content-Length header we have a fixed body.
|
|
* 🐞 panic in fs.go #824
* fix issue #875
Signed-off-by: Kirill Danshin <kirill@danshin.pro>
* improve issue 875
Co-authored-by: Fenny <fenny@gofiber.io>
* Update header.go
* Update header.go
Co-authored-by: Kirill Danshin <kirill@danshin.pro>
* remove foldReplacer
* Improve removeNewLines
Start replacing at the first character found, use bytes.Indexbyte to
make the function signature more logical. Both bytes.indexByte and
strings.IndexByte use exactly the same code:
https://github.com/golang/go/blob/0c703b37dffe74d3fffc04347884bb0ee2fba5b3/src/internal/bytealg/indexbyte_amd64.s#L8-L20
Co-authored-by: wernerr <rene.werner@verivox.com>
Co-authored-by: wernerr <rene@gofiber.io>
Co-authored-by: Fenny <fenny@gofiber.io>
Co-authored-by: Erik Dubbelboer <erik@dubbelboer.com>
|
|
Fixes https://github.com/valyala/fasthttp/issues/891
|
|
|
|
Co-authored-by: Mercurio <mmmercur@amazon.com>
|
|
Fixes https://github.com/valyala/fasthttp/issues/748
|