i want to remove/change server name
class MyServer(SimpleHTTPRequestHandler):
def _setHeader(self):
self.send_response(200)
self.send_header('Content-Type','text/html; charset=utf-8')
self.send_header('Access-Control-Allow-Origin',"*")
self.send_header('Access-Control-Allow-Credentials','true')
self.send_header('Server','Custom name')
self.end_headers()
self.send_header('Server','Custom name')
i tried to change server name but it's not working
please help me
Thanks in advance
Haven't used it in a while but the server_version field should do the trick.
class MyServer(SimpleHTTPRequestHandler):
def _setHeader(self):
self.send_response(200)
self.server_version = "Server: NameYouWant"
self.send_header('Content-Type', 'text/html; charset=utf-8')
self.send_header('Access-Control-Allow-Origin', "*")
self.send_header('Access-Control-Allow-Credentials', 'true')
self.end_headers()
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.