{"record":{"id":"819c3cfd90087b3c","repo":"quarkusio/quarkus","slug":"null-max-age","errorCode":null,"errorMessage":"null max age","messagePattern":"null max age","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":52,"sourceCode":"                    val = val.substring(0, val.length() - 1);\n            }\n\n            String lowercase = name.toLowerCase();\n            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            }","sourceCodeStart":34,"sourceCodeEnd":70,"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#L34-L70","documentation":"When parsing a Cache-Control header, the delegate found a 'max-age' directive but no '=' value following it (e.g. 'max-age' alone or 'max-age='), which is malformed per the HTTP spec, so it throws IllegalArgumentException.","triggerScenarios":"A Cache-Control header string containing 'max-age' with no value, e.g. 'Cache-Control: no-cache, max-age' or 'max-age=' passed to CacheControlDelegate.fromString.","commonSituations":"Misconfigured CDN/proxy emitting valueless max-age; hand-written header strings missing the seconds value; template/config errors generating cache headers.","solutions":["Correct the header to include a value: max-age=3600","Sanitize/validate the header string before parsing","Fix the server/proxy/CDN configuration producing the malformed directive","Catch IllegalArgumentException and treat as no-cache or ignore the header"],"exampleFix":"// before\nCache-Control: no-cache, max-age\n// after\nCache-Control: no-cache, max-age=3600","handlingStrategy":"validation","validationCode":"if (directive.startsWith(\"max-age\") && !directive.matches(\"max-age=\\\\d+\")) { throw new IllegalArgumentException(\"max-age 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(\"max age\")) { /* fallback: treat as no caching directives */ }\n}","preventionTips":["Always emit max-age=<seconds> with a value","Validate Cache-Control strings from external systems before parsing","Test CDN/proxy output for spec-compliant directives"],"tags":["http-headers","cache-control","http-spec","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"}