Skip to content

Commit

Permalink
Update for nits
Browse files Browse the repository at this point in the history
  • Loading branch information
AdityaAtulTewari authored and ns476 committed Aug 2, 2024
1 parent 1a2002d commit 53e3eb3
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 8 deletions.
2 changes: 1 addition & 1 deletion src/workerd/api/http-test.wd-test
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ const unitTests :Workerd.Config = (
( name = "SERVICE", service = "http-test" )
],
compatibilityDate = "2023-08-01",
compatibilityFlags = ["nodejs_compat", "service_binding_extra_handlers", "cache_header_enabled"],
compatibilityFlags = ["nodejs_compat", "service_binding_extra_handlers", "cache_option_enabled"],
)
),
],
Expand Down
7 changes: 3 additions & 4 deletions src/workerd/api/http.c++
Original file line number Diff line number Diff line change
Expand Up @@ -1076,10 +1076,9 @@ jsg::Ref<Request> Request::constructor(
}

KJ_IF_SOME(c, initDict.cache) {
bool cacheHeaderEnabled = FeatureFlags::get(js).getCacheHeaderEnabled();
if(!cacheHeaderEnabled) {
JSG_FAIL_REQUIRE(TypeError, kj::str("Unsupported cache mode: ", c, "\nYou may need to enable a compatability flag."));
}
JSG_REQUIRE(FeatureFlags::get(js).getCacheOptionEnabled(), TypeError, kj::str(
"Unsupported cache mode: ", c,
"\nYou may need to enable the cache_option_enabled compatability flag."));
cacheMode = getCacheModeFromName(c);
}

Expand Down
6 changes: 3 additions & 3 deletions src/workerd/io/compatibility-date.capnp
Original file line number Diff line number Diff line change
Expand Up @@ -505,9 +505,9 @@ struct CompatibilityFlags @0x8f8c1b68151b6cef {
$experimental;
# Enables of the new module registry implementation.

cacheHeaderEnabled @53 :Bool
$compatEnableFlag("cache_header_enabled")
$compatDisableFlag("cache_header_disabled")
cacheOptionEnabled @53 :Bool
$compatEnableFlag("cache_option_enabled")
$compatDisableFlag("cache_option_disabled")
$experimental;
# Enables the use of no-cache and no-store headers from requests
}

0 comments on commit 53e3eb3

Please sign in to comment.