Comments (4)
In what scenario is it necessary to send such a large header to the WebP Server Go?🤔
from webp_server_go.
The website, say example.com, has a large Cookie header. When visiting webp.example.com to request the webp server, the Cookie header is also sent by the browser. Our webp server is behind an nginx proxy and the status code 431 is prevented by not forwarding the Cookie header from nginx to the webp server.
Note, however, that this issue is not about the webp server returning 431. It is about the webp server not logging a request that results in status code 431.
from webp_server_go.
Okay, I got the reason for this.
WebP Server Go is using https://github.com/gofiber/fiber as HTTP framework, it has a constant called ReadBufferSize
:
ReadBufferSize specifies the I/O buffer size in bytes for incoming messages.
It's reflecting the same variable in FastHTTP, with description below:
// Per-connection buffer size for requests' reading.
// This also limits the maximum header size.
// Increase this buffer if your clients send multi-KB RequestURIs
// and/or multi-KB headers (for example, BIG cookies).
//
// Default: 4096
ReadBufferSize int `json:"read_buffer_size"`
Since is by default 4096, a large cookie of more characters will fail on FastHTTP first, so Fiber and WebP Server Go won't be able to log this request.
A quick fix for this(if you can compile by yourself), is to change
var app = fiber.New(fiber.Config{
ServerHeader: "WebP Server Go",
AppName: "WebP Server Go",
DisableStartupMessage: true,
ProxyHeader: "X-Real-IP",
})
to something like(You can adjust ReadBufferSize to something bigger that fits your needs):
var app = fiber.New(fiber.Config{
ServerHeader: "WebP Server Go",
AppName: "WebP Server Go",
DisableStartupMessage: true,
ProxyHeader: "X-Real-IP",
ReadBufferSize: 8192,
})
in webp-server.go
file and then compile the server(https://docs.webp.sh/build/), we are planning to make it changeable by supplying ENV in future version, stay tuned.
from webp_server_go.
This issue should be fixed in 0.9.12 now. You need to customize your own env READ_BUFFER_SIZE
from webp_server_go.
Related Issues (20)
- Checking if imageHeightWidthRatio is not zero before dividing HOT 2
- -dump-config flag does not work with Docker image HOT 2
- Empty file causes runtime error when it is expected to be a directory HOT 2
- Can't get webp_server_go work HOT 5
- NEF image size is wrong and extra parameters are invalid HOT 5
- Delete older files from storage HOT 2
- Clear older files autometically HOT 2
- Image not found! HOT 2
- Readme broken link HOT 1
- Exclude certain sub folder HOT 1
- A problem converting GIF images to AVIF format HOT 6
- set maxWidth and/or maxHeight HOT 9
- When the instantaneous request volume is large, a large amount of CPU and memory will be consumed. HOT 1
- Couldn't load xx.ico file HOT 3
- How do I configure and exclude links in MP4 format? HOT 5
- Server don't conversions images to jxl format in Firefox Nightly HOT 3
- Cropping mode environment variable HOT 4
- Directory traversal with malformed HTTP request HOT 3
- Webp Cloud是不是比开源的这个支持更多功能? HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from webp_server_go.