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

[BUG] (simulator) set req.http.VALUE = "" should not be [not set] #235

Open
bungoume opened this issue Dec 26, 2023 · 0 comments · May be fixed by #248
Open

[BUG] (simulator) set req.http.VALUE = "" should not be [not set] #235

bungoume opened this issue Dec 26, 2023 · 0 comments · May be fixed by #248
Assignees

Comments

@bungoume
Copy link
Contributor

Describe the problem
set req.http.VALUE = ""; andunset req.http.VALUE; should be different, but they seem to behave the same in falco v1.3.0.

VCL code that cause the problem / reproduceable
see https://fiddle.fastly.dev/fiddle/2e7f4a1c

// @scope: recv
// @suite: UNSET header
sub test_recv {
    set req.http.VALUE = "V";
    unset req.http.VALUE;
    assert.is_notset(req.http.VALUE);

    set req.http.MESSAGE = req.http.VALUE;
    assert.equal(req.http.MESSAGE, "(null)");
}

// @scope: recv
// @suite: EMPTY header
sub test_recv {
    set req.http.VALUE = "V";
    set req.http.VALUE = "";
    assert.equal(req.http.VALUE, "");

    set req.http.MESSAGE = req.http.VALUE;
    assert.equal(req.http.MESSAGE, "");
}

// @scope: recv
// @suite: NOTSET header
sub test_recv {
    set req.http.VALUE = "V";
    set req.http.VALUE = req.http.NOTSET;
    assert.is_notset(req.http.VALUE);

    set req.http.MESSAGE = req.http.VALUE;
    assert.equal(req.http.MESSAGE, "(null)");
}

Additional context
https://github.com/bungoume/falco-vcl-empty-test/blob/main/tests/header.test.vcl

@bungoume bungoume changed the title [BUG] (testing) set req.http.VALUE = "" should not be [not set] [BUG] (simulator) set req.http.VALUE = "" should not be [not set] Dec 26, 2023
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

Successfully merging a pull request may close this issue.

2 participants