Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

VCC assert on VCL with invalid HTTP header #3960

Closed
delthas opened this issue Jul 19, 2023 · 1 comment
Closed

VCC assert on VCL with invalid HTTP header #3960

delthas opened this issue Jul 19, 2023 · 1 comment

Comments

@delthas
Copy link
Contributor

delthas commented Jul 19, 2023

Expected Behavior

VCC fails with a friendly error message.

Current Behavior

VCC fails with:

Message from VCC-compiler:
Assert error in vcc_Eval_Var(), vcc_expr.c line 373:
  Condition(sym->kind == SYM_VAR) not true.
Running VCC-compiler failed, signal 6, core dumped
VCL compilation failed

Possible Solution

No response

Steps to Reproduce (for bugs)

Compile the following VCL:

vcl 4.1;
backend default none;
sub vcl_recv {
    if (req.http.0) {}
}

Context

I had old test cases laying around and found them failing when upgrading Varnish. I understand Varnish is now stricter wrt HTTP headers since a recent upgrade. I'll update the test case, but it might be clearer for users to have an error message rather than an assert.

Varnish Cache version

7.3.0

Operating system

No response

Source of binary packages used (if any)

No response

dridi added a commit to dridi/varnish-cache that referenced this issue Jul 20, 2023
@dridi dridi closed this as completed in 3731e9f Jul 20, 2023
@dridi
Copy link
Member

dridi commented Jul 20, 2023

I understand Varnish is now stricter wrt HTTP headers since a recent upgrade.

Yes and no.

There is stricter validation but "0" is a valid header name, but an invalid VCL symbol name. You can quote such header names, so we actually have better support for the HTTP grammar for header fields.

The following VCL should compile just fine:

vcl 4.1;
backend default none;
sub vcl_recv {
        if (req.http."0") {}
}

Thank you for your bug report!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants