Expand ETag precondition helper edge-case tests
Co-authored-by: Theo Browne <[email protected]>
This commit is contained in:
1 parent
e33e0e42dd
commit
ab400664bd
1 file changed
+8
@@ -969,6 +969,10 @@ describe("ifNoneMatchSatisfied", () => {
|
||||
expect(ifNoneMatchSatisfied(" ", "\"abc\"")).toBe(false);
|
||||
});
|
||||
|
||||
it("supports wildcard in array-valued headers", () => {
|
||||
expect(ifNoneMatchSatisfied(["\"foo\"", "*"], "\"abc\"")).toBe(true);
|
||||
});
|
||||
|
||||
it("matches wildcard headers", () => {
|
||||
expect(ifNoneMatchSatisfied("*", "\"abc\"")).toBe(true);
|
||||
});
|
||||
@@ -997,6 +1001,10 @@ describe("ifMatchSatisfied", () => {
|
||||
expect(ifMatchSatisfied(undefined, "\"abc\"")).toBe(true);
|
||||
});
|
||||
|
||||
it("treats empty header values as non-restrictive", () => {
|
||||
expect(ifMatchSatisfied(" ", "\"abc\"")).toBe(true);
|
||||
});
|
||||
|
||||
it("supports wildcard and exact strong matches", () => {
|
||||
expect(ifMatchSatisfied("*", "\"abc\"")).toBe(true);
|
||||
expect(ifMatchSatisfied("\"abc\"", "\"abc\"")).toBe(true);
|
||||
|
||||
Reference in new issue
Block a user