Ruby: fix qldoc

This commit is contained in:
Alex Ford
2023-06-07 15:55:01 +01:00
parent 57508b2b3b
commit a5d8db6317
4 changed files with 20 additions and 1 deletions

View File

@@ -1,3 +1,7 @@
/**
* Provides modeling for the Rack library.
*/
/**
* Provides modeling for the Rack library.
*/

View File

@@ -1,3 +1,7 @@
/**
* Provides modeling for Rack applications.
*/
private import codeql.ruby.ApiGraphs
private import codeql.ruby.DataFlow
private import codeql.ruby.typetracking.TypeTracker

View File

@@ -1,3 +1,7 @@
/**
* Provides modeling for the `Mime` component of the `Rack` library.
*/
private import codeql.ruby.ApiGraphs
private import codeql.ruby.DataFlow
@@ -1288,7 +1292,7 @@ private predicate mimeTypeMatches(string ext, string mimeType) {
}
/**
* Provides modeling for the `Response` component of the `Rack` library.
* Provides modeling for the `Mime` component of the `Rack` library.
*/
module Mime {
class MimetypeCall extends DataFlow::CallNode {
@@ -1300,6 +1304,7 @@ module Mime {
result = this.getArgument(0).getConstantValue().getStringlikeValue()
}
/** Gets the canonical MIME type string returned by this call. */
string getMimeType() { mimeTypeMatches(this.getExtension(), result) }
}
}

View File

@@ -1,3 +1,7 @@
/**
* Provides modeling for the `Response` component of the `Rack` library.
*/
private import codeql.ruby.AST
private import codeql.ruby.ApiGraphs
private import codeql.ruby.Concepts
@@ -17,6 +21,7 @@ module Private {
private DataFlow::Node trackInt(int i) { trackInt(TypeTracker::end(), i).flowsTo(result) }
/** A `DataFlow::Node` that may be a rack response. This is detected heuristically, if something "looks like" a rack response syntactically then we consider it to be a potential response node. */
class PotentialResponseNode extends DataFlow::ArrayLiteralNode {
// [status, headers, body]
PotentialResponseNode() {
@@ -83,6 +88,7 @@ module Public {
override string getMimetypeDefault() { none() }
}
/** A `DataFlow::Node` returned from a rack request that has a redirect HTTP status code. */
class RedirectResponse extends ResponseNode, Http::Server::HttpRedirectResponse::Range {
RedirectResponse() { this.getAStatusCode() = [300, 301, 302, 303, 307, 308] }