Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions runtime/fastly/builtins/cache-core.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -612,6 +612,14 @@ bool CacheEntry::body(JSContext *cx, unsigned argc, JS::Value *vp) {
}
options.end = JS::ToUint64(end);
}

// Reject cases where the start is greater than the end.
// Ideally this would be a host-side check... but we didn't do it there to begin with,
// so we couple it to an SDK/runtime upgrade.
if (!start_val.isUndefined() && !end_val.isUndefined() && options.end > options.start) {
JS_ReportErrorASCII(cx, "end field is before the start field");
return false;
}
}

auto res = handle.get_body(options);
Expand Down
Loading