mirror of
https://github.com/AdguardTeam/AdGuardHome.git
synced 2025-05-04 23:12:56 +03:00
- Web: flush the bufferred response data before performing global operations
This commit is contained in:
parent
2191c49161
commit
e24143a196
3 changed files with 12 additions and 4 deletions
|
@ -351,6 +351,11 @@ func (web *Web) handleInstallConfigure(w http.ResponseWriter, r *http.Request) {
|
|||
|
||||
registerControlHandlers()
|
||||
|
||||
returnOK(w)
|
||||
if f, ok := w.(http.Flusher); ok {
|
||||
f.Flush()
|
||||
}
|
||||
|
||||
// this needs to be done in a goroutine because Shutdown() is a blocking call, and it will block
|
||||
// until all requests are finished, and _we_ are inside a request right now, so it will block indefinitely
|
||||
if restartHTTP {
|
||||
|
@ -358,8 +363,6 @@ func (web *Web) handleInstallConfigure(w http.ResponseWriter, r *http.Request) {
|
|||
_ = Context.web.httpServer.Shutdown(context.TODO())
|
||||
}()
|
||||
}
|
||||
|
||||
returnOK(w)
|
||||
}
|
||||
|
||||
func (web *Web) registerInstallHandlers() {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue