Re: httpd: add custom HTTP header support #2

Christian Schulte <[email protected]>
Newsgroups gmane.os.openbsd.tech
Message-ID <[email protected]>
Am 11.07.2026 um 16:12 schrieb Rafael Sadowski:
> diff --git a/parse.y b/parse.y
> index d6bc335..394dc50 100644
> --- a/parse.y
> +++ b/parse.y
> @@ -713,6 +716,147 @@ banner		: BANNER		{
>  		}
>  		;
>  
> +header		: HEADER REMOVE STRING	{
> +			struct custom_header	*hdr;
> +
> +			if ((hdr = calloc(1, sizeof(*hdr))) == NULL)
> +				fatal("out of memory");
> +
> +			if (strlcpy(hdr->name, $3, sizeof(hdr->name)) >=
> +			    sizeof(hdr->name)) {
> +				yyerror("header name truncated");
> +				free($3);
> +				free(hdr);
> +				YYERROR;
> +			}
> +			if (strcmp("Server", hdr->name) == 0) {
> +				yyerror("'header remover Server' "
                                                      ^^

Regards,
-- 
Christian
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.