web - Python SimpleHTTPServer: change response header -
i use python's simplehttpserver tests applications.
now test need change in server response header field "server". have "server: simplehttp/0.6 python/2.7.3" "server: apache123".
is possible change field? thx.
if wanted have easy edit use this:
import simplehttpserver import basehttpserver def main(): request_handler = simplehttpserver.simplehttprequesthandler request_handler.server_version = "server: apache123" request_handler.sys_version = "" basehttpserver.test(handlerclass = request_handler, serverclass = basehttpserver.httpserver) if __name__ == "__main__": main() you can run same way run simplehttpserver:
python you_script_name.py port you edit take name want command line.
Comments
Post a Comment