]> Cypherpunks.ru repositories - gocheese.git/blobdiff - main.go
Set Server and User-Agent headers
[gocheese.git] / main.go
diff --git a/main.go b/main.go
index 5e4f25c60d2f26f80d70b48acdfecaf4c633c1b9..f4a4359e677f63e54f5723f6bd06fa5d8fc6a83d 100644 (file)
--- a/main.go
+++ b/main.go
@@ -47,6 +47,7 @@ import (
 
 const (
        Version   = "3.0.0"
+       UserAgent = "GoCheese/" + Version
        HTMLBegin = `<!DOCTYPE html>
 <html>
   <head>
@@ -231,6 +232,7 @@ func servePkg(w http.ResponseWriter, r *http.Request, pkgName, filename string)
 }
 
 func handler(w http.ResponseWriter, r *http.Request) {
+       w.Header().Set("Server", UserAgent)
        switch r.Method {
        case "GET":
                var path string