File tree Expand file tree Collapse file tree 3 files changed +17
-3
lines changed
test/experimental/library-tests/frameworks/stdlib Expand file tree Collapse file tree 3 files changed +17
-3
lines changed Original file line number Diff line number Diff line change @@ -1616,6 +1616,20 @@ private module Stdlib {
1616
1616
)
1617
1617
}
1618
1618
}
1619
+
1620
+ /**
1621
+ * The entry-point for handling a request with a `BaseHTTPRequestHandler` subclass.
1622
+ *
1623
+ * Not essential for any functionality, but provides a consistent modeling.
1624
+ */
1625
+ private class RequestHandlerFunc extends HTTP:: Server:: RequestHandler:: Range {
1626
+ RequestHandlerFunc ( ) {
1627
+ this = any ( HTTPRequestHandlerClassDef cls ) .getAMethod ( ) and
1628
+ this .getName ( ) = "do_" + HTTP:: httpVerb ( )
1629
+ }
1630
+
1631
+ override Parameter getARoutedParameter ( ) { none ( ) }
1632
+ }
1619
1633
}
1620
1634
1621
1635
// ---------------------------------------------------------------------------
Original file line number Diff line number Diff line change 1
- /** Gets an HTTP verb */
1
+ /** Gets an HTTP verb, in upper case */
2
2
string httpVerb ( ) {
3
3
result = "GET" or
4
4
result = "POST" or
Original file line number Diff line number Diff line change @@ -78,7 +78,7 @@ def taint_sources(self):
78
78
ensure_tainted (form )
79
79
80
80
81
- def do_GET (self ): # $ MISSING: requestHandler
81
+ def do_GET (self ): # $ requestHandler
82
82
# send_response will log a line to stderr
83
83
self .send_response (200 )
84
84
self .send_header ("Content-type" , "text/plain; charset=utf-8" )
@@ -88,7 +88,7 @@ def do_GET(self): # $ MISSING: requestHandler
88
88
print (self .headers )
89
89
90
90
91
- def do_POST (self ): # $ MISSING: requestHandler
91
+ def do_POST (self ): # $ requestHandler
92
92
form = cgi .FieldStorage (
93
93
self .rfile ,
94
94
self .headers ,
You can’t perform that action at this time.
0 commit comments