Skip to content

Commit a5d8db6

Browse files
committed
Ruby: fix qldoc
1 parent 57508b2 commit a5d8db6

File tree

4 files changed

+20
-1
lines changed

4 files changed

+20
-1
lines changed

ruby/ql/lib/codeql/ruby/frameworks/Rack.qll

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
/**
2+
* Provides modeling for the Rack library.
3+
*/
4+
15
/**
26
* Provides modeling for the Rack library.
37
*/

ruby/ql/lib/codeql/ruby/frameworks/rack/internal/App.qll

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
/**
2+
* Provides modeling for Rack applications.
3+
*/
4+
15
private import codeql.ruby.ApiGraphs
26
private import codeql.ruby.DataFlow
37
private import codeql.ruby.typetracking.TypeTracker

ruby/ql/lib/codeql/ruby/frameworks/rack/internal/Mime.qll

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
/**
2+
* Provides modeling for the `Mime` component of the `Rack` library.
3+
*/
4+
15
private import codeql.ruby.ApiGraphs
26
private import codeql.ruby.DataFlow
37

@@ -1288,7 +1292,7 @@ private predicate mimeTypeMatches(string ext, string mimeType) {
12881292
}
12891293

12901294
/**
1291-
* Provides modeling for the `Response` component of the `Rack` library.
1295+
* Provides modeling for the `Mime` component of the `Rack` library.
12921296
*/
12931297
module Mime {
12941298
class MimetypeCall extends DataFlow::CallNode {
@@ -1300,6 +1304,7 @@ module Mime {
13001304
result = this.getArgument(0).getConstantValue().getStringlikeValue()
13011305
}
13021306

1307+
/** Gets the canonical MIME type string returned by this call. */
13031308
string getMimeType() { mimeTypeMatches(this.getExtension(), result) }
13041309
}
13051310
}

ruby/ql/lib/codeql/ruby/frameworks/rack/internal/Response.qll

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
/**
2+
* Provides modeling for the `Response` component of the `Rack` library.
3+
*/
4+
15
private import codeql.ruby.AST
26
private import codeql.ruby.ApiGraphs
37
private import codeql.ruby.Concepts
@@ -17,6 +21,7 @@ module Private {
1721

1822
private DataFlow::Node trackInt(int i) { trackInt(TypeTracker::end(), i).flowsTo(result) }
1923

24+
/** 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. */
2025
class PotentialResponseNode extends DataFlow::ArrayLiteralNode {
2126
// [status, headers, body]
2227
PotentialResponseNode() {
@@ -83,6 +88,7 @@ module Public {
8388
override string getMimetypeDefault() { none() }
8489
}
8590

91+
/** A `DataFlow::Node` returned from a rack request that has a redirect HTTP status code. */
8692
class RedirectResponse extends ResponseNode, Http::Server::HttpRedirectResponse::Range {
8793
RedirectResponse() { this.getAStatusCode() = [300, 301, 302, 303, 307, 308] }
8894

0 commit comments

Comments
 (0)