|
@@ -48,14 +48,12 @@ func (s *httpdServer) listenAndServe() error {
|
|
httpServer := &http.Server{
|
|
httpServer := &http.Server{
|
|
Handler: s.router,
|
|
Handler: s.router,
|
|
ReadHeaderTimeout: 30 * time.Second,
|
|
ReadHeaderTimeout: 30 * time.Second,
|
|
- IdleTimeout: 120 * time.Second,
|
|
|
|
|
|
+ ReadTimeout: 60 * time.Second,
|
|
|
|
+ WriteTimeout: 60 * time.Second,
|
|
|
|
+ IdleTimeout: 60 * time.Second,
|
|
MaxHeaderBytes: 1 << 16, // 64KB
|
|
MaxHeaderBytes: 1 << 16, // 64KB
|
|
ErrorLog: log.New(&logger.StdLoggerWrapper{Sender: logSender}, "", 0),
|
|
ErrorLog: log.New(&logger.StdLoggerWrapper{Sender: logSender}, "", 0),
|
|
}
|
|
}
|
|
- if !s.binding.EnableWebClient {
|
|
|
|
- httpServer.ReadTimeout = 60 * time.Second
|
|
|
|
- httpServer.WriteTimeout = 90 * time.Second
|
|
|
|
- }
|
|
|
|
if certMgr != nil && s.binding.EnableHTTPS {
|
|
if certMgr != nil && s.binding.EnableHTTPS {
|
|
config := &tls.Config{
|
|
config := &tls.Config{
|
|
GetCertificate: certMgr.GetCertificateFunc(),
|
|
GetCertificate: certMgr.GetCertificateFunc(),
|
|
@@ -111,7 +109,7 @@ func (s *httpdServer) refreshCookie(next http.Handler) http.Handler {
|
|
}
|
|
}
|
|
|
|
|
|
func (s *httpdServer) handleWebClientLoginPost(w http.ResponseWriter, r *http.Request) {
|
|
func (s *httpdServer) handleWebClientLoginPost(w http.ResponseWriter, r *http.Request) {
|
|
- r.Body = http.MaxBytesReader(w, r.Body, maxRequestSize)
|
|
|
|
|
|
+ r.Body = http.MaxBytesReader(w, r.Body, maxLoginPostSize)
|
|
common.Connections.AddNetworkConnection()
|
|
common.Connections.AddNetworkConnection()
|
|
defer common.Connections.RemoveNetworkConnection()
|
|
defer common.Connections.RemoveNetworkConnection()
|
|
|
|
|
|
@@ -185,7 +183,7 @@ func (s *httpdServer) handleWebClientLoginPost(w http.ResponseWriter, r *http.Re
|
|
}
|
|
}
|
|
|
|
|
|
func (s *httpdServer) handleWebAdminLoginPost(w http.ResponseWriter, r *http.Request) {
|
|
func (s *httpdServer) handleWebAdminLoginPost(w http.ResponseWriter, r *http.Request) {
|
|
- r.Body = http.MaxBytesReader(w, r.Body, maxRequestSize)
|
|
|
|
|
|
+ r.Body = http.MaxBytesReader(w, r.Body, maxLoginPostSize)
|
|
if err := r.ParseForm(); err != nil {
|
|
if err := r.ParseForm(); err != nil {
|
|
renderLoginPage(w, err.Error())
|
|
renderLoginPage(w, err.Error())
|
|
return
|
|
return
|