3ac5eec3 by astaxie

fix #253

1 parent 060631e9
...@@ -48,6 +48,7 @@ var ( ...@@ -48,6 +48,7 @@ var (
48 CopyRequestBody bool //When in raw application, You want to the reqeustbody 48 CopyRequestBody bool //When in raw application, You want to the reqeustbody
49 TemplateLeft string 49 TemplateLeft string
50 TemplateRight string 50 TemplateRight string
51 BeegoServerName string
51 ) 52 )
52 53
53 func init() { 54 func init() {
...@@ -80,6 +81,7 @@ func init() { ...@@ -80,6 +81,7 @@ func init() {
80 XSRFExpire = 0 81 XSRFExpire = 0
81 TemplateLeft = "{{" 82 TemplateLeft = "{{"
82 TemplateRight = "}}" 83 TemplateRight = "}}"
84 BeegoServerName = "beegoServer"
83 ParseConfig() 85 ParseConfig()
84 runtime.GOMAXPROCS(runtime.NumCPU()) 86 runtime.GOMAXPROCS(runtime.NumCPU())
85 } 87 }
...@@ -173,6 +175,9 @@ func ParseConfig() (err error) { ...@@ -173,6 +175,9 @@ func ParseConfig() (err error) {
173 if keyfile := AppConfig.String("HttpKeyFile"); keyfile != "" { 175 if keyfile := AppConfig.String("HttpKeyFile"); keyfile != "" {
174 HttpKeyFile = keyfile 176 HttpKeyFile = keyfile
175 } 177 }
178 if serverName := AppConfig.String("BeegoServerName"); serverName != "" {
179 BeegoServerName = serverName
180 }
176 } 181 }
177 return nil 182 return nil
178 } 183 }
......
...@@ -292,7 +292,7 @@ func (p *ControllerRegistor) ServeHTTP(rw http.ResponseWriter, r *http.Request) ...@@ -292,7 +292,7 @@ func (p *ControllerRegistor) ServeHTTP(rw http.ResponseWriter, r *http.Request)
292 }() 292 }()
293 293
294 w := &responseWriter{writer: rw} 294 w := &responseWriter{writer: rw}
295 w.Header().Set("Server", "beegoServer") 295 w.Header().Set("Server", BeegoServerName)
296 context := &beecontext.Context{ 296 context := &beecontext.Context{
297 ResponseWriter: w, 297 ResponseWriter: w,
298 Request: r, 298 Request: r,
......
Styling with Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!