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

Popular posts from this blog

php - SPIP: From Tag directly to an article -

jquery - isAjaxRequest always return false -

ruby on rails - In a controller spec, how to find a specific tag in the generated view? -