mirror of
https://github.com/github/codeql.git
synced 2026-02-28 04:43:42 +01:00
Fix existing JaxRs tests
* Expose getContentTypeString for use by tests * Use it to get constant arguments to @Produces annotations * Note that text/html is xss-vulnerable (I have no idea how it ever came to expect exactly text/plain)
This commit is contained in:
@@ -283,7 +283,10 @@ class MessageBodyReaderRead extends Method {
|
||||
}
|
||||
}
|
||||
|
||||
private string getContentTypeString(Expr e) {
|
||||
/**
|
||||
* Gets a constant content-type described by expression `e` (either a string constant or a Jax-RS MediaType field access).
|
||||
*/
|
||||
string getContentTypeString(Expr e) {
|
||||
result = e.(CompileTimeConstantExpr).getStringValue() and
|
||||
result != ""
|
||||
or
|
||||
|
||||
Reference in New Issue
Block a user