{"record":{"id":"be67223530a0fec0","repo":"quarkusio/quarkus","slug":"null-s-maxage","errorCode":null,"errorMessage":"null s-maxage","messagePattern":"null s-maxage","errorType":"validation","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"warning","filePath":"independent-projects/resteasy-reactive/common/runtime/src/main/java/org/jboss/resteasy/reactive/common/headers/CacheControlDelegate.java","lineNumber":56,"sourceCode":"            if (\"no-cache\".equals(lowercase)) {\n                result.setNoCache(true);\n                if (val != null && !\"\".equals(val)) {\n                    result.getNoCacheFields().add(val);\n                }\n            } else if (\"private\".equals(lowercase)) {\n                result.setPrivate(true);\n                if (val != null && !\"\".equals(val)) {\n                    result.getPrivateFields().add(val);\n                }\n            } else if (\"no-store\".equals(lowercase)) {\n                result.setNoStore(true);\n            } else if (\"max-age\".equals(lowercase)) {\n                if (val == null)\n                    throw new IllegalArgumentException(\"null max age\");\n                result.setMaxAge(Integer.valueOf(val));\n            } else if (\"s-maxage\".equals(lowercase)) {\n                if (val == null)\n                    throw new IllegalArgumentException(\"null s-maxage\");\n                result.setSMaxAge(Integer.valueOf(val));\n            } else if (\"no-transform\".equals(lowercase)) {\n                result.setNoTransform(true);\n            } else if (\"must-revalidate\".equals(lowercase)) {\n                result.setMustRevalidate(true);\n            } else if (\"proxy-revalidate\".equals(lowercase)) {\n                result.setProxyRevalidate(true);\n            } else if (\"public\".equals(lowercase)) {\n                result.setPublic(true);\n            } else {\n                if (val == null)\n                    val = \"\";\n                result.getCacheExtension().put(name, val);\n            }\n        }\n        return result;\n    }\n","sourceCodeStart":38,"sourceCodeEnd":74,"githubUrl":"https://github.com/quarkusio/quarkus/blob/e1c734241f34c7919086ceb4c9262b4a58f6de44/independent-projects/resteasy-reactive/common/runtime/src/main/java/org/jboss/resteasy/reactive/common/headers/CacheControlDelegate.java#L38-L74","documentation":"IllegalArgumentException from CacheControlDelegate.fromString: while parsing a Cache-Control header directive that takes a delta-seconds value (s-maxage or max-age), no numeric value followed the '=' — e.g. 's-maxage='. The named directive (in the message) lacks its required numeric argument.","triggerScenarios":"A Cache-Control header string containing 's-maxage' with no value, e.g. 'Cache-Control: public, s-maxage', parsed via CacheControlDelegate.fromString.","commonSituations":"CDN (Fastly/CloudFront/Varnish) configurations emitting a valueless s-maxage; hand-rolled header generation missing the value; typos like 's-maxage 600' (space instead of =).","solutions":["Fix the directive to 's-maxage=<seconds>'","Validate header values before parsing","Correct the CDN/proxy configuration emitting the malformed directive","Catch IllegalArgumentException and fall back to ignoring shared-cache directives"],"exampleFix":"// before\nCache-Control: public, s-maxage\n// after\nCache-Control: public, s-maxage=600","handlingStrategy":"validation","validationCode":"if (directive.startsWith(\"s-maxage\") && !directive.matches(\"s-maxage=\\\\d+\")) { throw new IllegalArgumentException(\"s-maxage requires a numeric value: \" + directive); }","typeGuard":null,"tryCatchPattern":"try {\n    CacheControl cc = CacheControlDelegate.INSTANCE.fromString(headerValue);\n} catch (IllegalArgumentException e) {\n    if (e.getMessage().contains(\"s-maxage\")) { /* ignore shared-cache directive or fail fast */ }\n}","preventionTips":["Always emit s-maxage=<seconds> with a value","Use '=' not whitespace between directive and value","Validate header output of CDN configurations (Fastly/CloudFront/Varnish)"],"tags":["http-headers","cache-control","cdn","malformed-header"],"backgroundTag":"malformed-cache-control","analyzedSha":"e1c734241f34c7919086ceb4c9262b4a58f6de44","analyzedAt":"2026-09-05T17:01:29.979Z","contentChangedAt":"2026-09-05T17:01:29.979Z","schemaVersion":2},"datasetVersion":"2026-09-12T22:17:10.623Z"}