def test_Method_FullURL_UsernamePasswordCGIArgs_Protocol(self): "Accepted URL Format" r = "BIBBLE foo://toor:[email protected]/bla?this&that=other PROTO/3.3" try: foo=requestLine(r) except "BadRequest": foo= "Line is not parseable - does not match:\nMETHOD proto://(user(:passwd)?@)?domain/url proto/ver" print foo
def test_Method_FullURL_UsernamePasswordCGIArgs_Protocol(self): "Accepted URL Format" r = "BIBBLE foo://toor:[email protected]/bla?this&that=other PROTO/3.3" try: foo = requestLine(r) except "BadRequest": foo = "Line is not parseable - does not match:\nMETHOD proto://(user(:passwd)?@)?domain/url proto/ver" print foo
def test_AcceptedForms(self): requests = [] for REQ in requests: print "Parsing request:", REQ try: foo = requestLine(REQ) except "BadRequest": foo = "Line is not parseable - does not match:\nMETHOD proto://(user(:passwd)?@)?domain/url proto/ver" print foo print
def test_AcceptedForms(self): requests = [ ] for REQ in requests: print "Parsing request:", REQ try: foo=requestLine(REQ) except "BadRequest": foo= "Line is not parseable - does not match:\nMETHOD proto://(user(:passwd)?@)?domain/url proto/ver" print foo print
def test_http09_minimal(self): "Rejected URL Format" r = "/" foo=requestLine(r)
result = result + self.reqprotocol + "://" if self.user: result = result + self.user if self.passwd: result = result + ":" + self.passwd result = result + "@" result = result + self.domain result = result + self.url +" " result = result + self.protocol + "/" result = result + self.version return result if __name__ =="__main__": # These are the only format requests we accept. # All others are rejected requests = [ "BIBBLE foo://toor:[email protected]/bla?this&that=other PROTO/3.3", "BIBBLE foo://[email protected]/bla?this&that=other PROTO/3.3", "BIBBLE foo://server.bigcompany.com/bla?this&that=other PROTO/3.3", "BIBBLE foo://server.bigcompany.com/ PROTO/3.3", "foo://server.bigcompany.com/ PROTO/3.3" ] for REQ in requests: print "Parsing request:", REQ try: foo=requestLine(REQ) except "BadRequest": foo= "Line is not parseable - does not match:\nMETHOD proto://(user(:passwd)?@)?domain/url proto/ver" print foo print
def test_http09_minimal(self): "Rejected URL Format" r = "/" foo = requestLine(r)
result = result + self.reqprotocol + "://" if self.user: result = result + self.user if self.passwd: result = result + ":" + self.passwd result = result + "@" result = result + self.domain result = result + self.url + " " result = result + self.protocol + "/" result = result + self.version return result if __name__ == "__main__": # These are the only format requests we accept. # All others are rejected requests = [ "BIBBLE foo://toor:[email protected]/bla?this&that=other PROTO/3.3", "BIBBLE foo://[email protected]/bla?this&that=other PROTO/3.3", "BIBBLE foo://server.bigcompany.com/bla?this&that=other PROTO/3.3", "BIBBLE foo://server.bigcompany.com/ PROTO/3.3", "foo://server.bigcompany.com/ PROTO/3.3" ] for REQ in requests: print "Parsing request:", REQ try: foo = requestLine(REQ) except "BadRequest": foo = "Line is not parseable - does not match:\nMETHOD proto://(user(:passwd)?@)?domain/url proto/ver" print foo print