Co-authored-by: nguyenkd27 <nguyenkd27@gmail.com>
Co-authored-by: dundargoc <gocdundar@gmail.com>
Co-authored-by: Yochem van Rosmalen <git@yochem.nl>
Co-authored-by: Tuure Piitulainen <tuure.piitulainen@gmail.com>
Co-authored-by: Maria Solano <majosolano99@gmail.com>
Co-authored-by: tao <2471314@gmail.com>
This commit is contained in:
Justin M. Keyes
2025-11-16 20:36:07 -08:00
committed by GitHub
parent 6e2b514813
commit c8b6852363
12 changed files with 55 additions and 51 deletions

View File

@@ -17,14 +17,13 @@ local function format_message_with_content_length(message)
})
end
--- Extract content-length from the header.
--- Extract `content-length` from the header.
---
--- The structure of header fields conforms to the [HTTP semantic](https://tools.ietf.org/html/rfc7230#section-3.2).
--- i.e., `header-field = field-name : OWS field-value OWS`,
--- OWS means optional whitespace (Space/Horizontal Tab).
--- The structure of header fields conforms to [HTTP semantics](https://tools.ietf.org/html/rfc7230#section-3.2),
--- i.e., `header-field = field-name : OWS field-value OWS`. OWS means optional whitespace (space/horizontal tabs).
---
--- we ignore lines ending with `\n` that don't contain `content-length`, since some servers
--- write log to stdout and there's no way to avoid it.
--- We ignore lines ending with `\n` that don't contain `content-length`, since some servers
--- write log to standard output and there's no way to avoid it.
--- See https://github.com/neovim/neovim/pull/35743#pullrequestreview-3379705828
--- @param header string The header to parse
--- @return integer