Skip to content

Commit 2dce086

Browse files
committed
[grid] Using constant for the section [skip ci]
1 parent 6ba4703 commit 2dce086

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

java/server/src/org/openqa/selenium/grid/server/NetworkOptions.java

+6-4
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,8 @@
3434

3535
public class NetworkOptions {
3636

37+
private static final String NETWORK_SECTION = "network";
38+
3739
private final Config config;
3840
// These are commonly used by process which can't set various headers.
3941
private final Set<String> SKIP_CHECKS_ON = ImmutableSet.of("/status", "/readyz");
@@ -50,16 +52,16 @@ public Filter getSpecComplianceChecks() {
5052
// Base case: we do nothing
5153
Filter toReturn = httpHandler -> httpHandler;
5254

53-
if (config.getBool("network", "relax-checks").orElse(false)) {
55+
if (config.getBool(NETWORK_SECTION, "relax-checks").orElse(false)) {
5456
return toReturn;
5557
}
5658

57-
if (config.getBool("network", "check_content_type").orElse(true)) {
59+
if (config.getBool(NETWORK_SECTION, "check_content_type").orElse(true)) {
5860
toReturn = toReturn.andThen(new CheckContentTypeHeader(SKIP_CHECKS_ON));
5961
}
6062

61-
boolean checkOrigin = config.getBool("network", "check_origin_header").orElse(true);
62-
Optional<List<String>> allowedOrigins = config.getAll("network", "allowed_origins");
63+
boolean checkOrigin = config.getBool(NETWORK_SECTION, "check_origin_header").orElse(true);
64+
Optional<List<String>> allowedOrigins = config.getAll(NETWORK_SECTION, "allowed_origins");
6365

6466
if (checkOrigin || allowedOrigins.isPresent()) {
6567
toReturn = toReturn.andThen(new CheckOriginHeader(allowedOrigins.orElse(ImmutableList.of()), SKIP_CHECKS_ON));

0 commit comments

Comments
 (0)