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 {
16161616 )
16171617 }
16181618 }
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+ }
16191633 }
16201634
16211635 // ---------------------------------------------------------------------------
Original file line number Diff line number Diff line change 1- /** Gets an HTTP verb */
1+ /** Gets an HTTP verb, in upper case */
22string httpVerb ( ) {
33 result = "GET" or
44 result = "POST" or
Original file line number Diff line number Diff line change @@ -78,7 +78,7 @@ def taint_sources(self):
7878 ensure_tainted (form )
7979
8080
81- def do_GET (self ): # $ MISSING: requestHandler
81+ def do_GET (self ): # $ requestHandler
8282 # send_response will log a line to stderr
8383 self .send_response (200 )
8484 self .send_header ("Content-type" , "text/plain; charset=utf-8" )
@@ -88,7 +88,7 @@ def do_GET(self): # $ MISSING: requestHandler
8888 print (self .headers )
8989
9090
91- def do_POST (self ): # $ MISSING: requestHandler
91+ def do_POST (self ): # $ requestHandler
9292 form = cgi .FieldStorage (
9393 self .rfile ,
9494 self .headers ,
You can’t perform that action at this time.
0 commit comments