brotlihack

package
v0.2.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 15, 2025 License: AGPL-3.0 Imports: 2 Imported by: 0

Documentation

Overview

Package brotlihack implements a wrapper to workaround a non-fatal error returned by the Brotli package.

We need to handle Brotli a little specially because the decompresser we're using doesn't like Brave's response for some reason. While this is specific to *just* Brave right now, we might as well make it available for all engines in the off chance they need it too.

The error from the decompressor isn't fatal but it is treated as such: https://github.com/andybalholm/brotli/blob/57434b509141a6ee9681116b8d552069126e615f/reader.go#L74-L76 https://github.com/valyala/fasthttp/blob/b06f4e21d918faa84ae0aa12c9e4dc7285b9767e/http.go#L505-L512

So my crappy solution is to rewrite the part where it decompresses Brotli and explicitly ignore that "brotli: excessive input" error.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewReader

func NewReader(r io.Reader) *brotliHackReader

NewReader creates a new wrapped Brotli decoder.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL
JackTT - Gopher 🇻🇳