The default allowed URI size is 8177 characters in a GET request. Simple python code for such testing.
#!/usr/bin/env python2 import sys import socket if __name__ == "__main__": string = sys.argv[1] buf_get = "x" * int(string) buf_size = 1024 request = "HEAD %s HTTP/1.1\nHost:localhost\n\n" % buf_get print "===>", request sock_http = socket.socket(socket.AF_INET, socket.SOCK_STREAM) sock_http.connect(("localhost", 80)) sock_http.send(request) while True: print "==>", sock_http.recv(buf_size) if not sock_http.recv(buf_size): break sock_http.close()
For 8178 characters you will receive the following message: HTTP / 1.1 414 Request-URI Too Large
Tom Lime Sep 14 '11 at 11:57 2011-09-14 11:57
source share