fix(internal): silence unsolicited response log lines

Signed-off-by: Xe Iaso <me@xeiaso.net>
This commit is contained in:
Xe Iaso 2025-08-03 19:02:44 +00:00
parent 7c80c23e90
commit 0c97bd7c4a
No known key found for this signature in database
2 changed files with 4 additions and 0 deletions

View File

@ -28,6 +28,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- The contact email in the LibreJS header has been changed. - The contact email in the LibreJS header has been changed.
- The hard dependency on WebCrypto has been removed, allowing a proof of work challenge to work over plain (unencrypted) HTTP. - The hard dependency on WebCrypto has been removed, allowing a proof of work challenge to work over plain (unencrypted) HTTP.
- The legacy JSON based policy file example has been removed and all documentation for how to write a policy file in JSON has been deleted. JSON based policy files will still work, but YAML is the superior option for Anubis configuration. - The legacy JSON based policy file example has been removed and all documentation for how to write a policy file in JSON has been deleted. JSON based policy files will still work, but YAML is the superior option for Anubis configuration.
- A standard library HTTP server log message about HTTP pipelining not working has been filtered out of Anubis' logs. There is no action that can be taken about it.
### Breaking changes ### Breaking changes

View File

@ -50,6 +50,9 @@ func (elf *ErrorLogFilter) Write(p []byte) (n int, err error) {
if strings.Contains(logMessage, "context canceled") { if strings.Contains(logMessage, "context canceled") {
return len(p), nil // Suppress the log by doing nothing return len(p), nil // Suppress the log by doing nothing
} }
if strings.Contains(logMessage, "Unsolicited response received on idle HTTP channel") {
return len(p), nil
}
if elf.Unwrap != nil { if elf.Unwrap != nil {
return elf.Unwrap.Writer().Write(p) return elf.Unwrap.Writer().Write(p)
} }