mirror of
https://github.com/github/codeql.git
synced 2026-01-07 11:40:27 +01:00
Ruby: fix qldoc
This commit is contained in:
@@ -1,3 +1,7 @@
|
||||
/**
|
||||
* Provides modeling for the Rack library.
|
||||
*/
|
||||
|
||||
/**
|
||||
* Provides modeling for the Rack library.
|
||||
*/
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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) }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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] }
|
||||
|
||||
|
||||
Reference in New Issue
Block a user