Do not consider edit mode as a history entry
This commit is contained in:
@@ -465,6 +465,15 @@ func (h *handler) handlePost(w http.ResponseWriter, r *http.Request, urlPath, fs
|
||||
}
|
||||
}
|
||||
}
|
||||
// The editor saves via fetch so the save and its result share one history
|
||||
// entry (see assets/history-nav.js). Hand it the target instead of a 303:
|
||||
// the browser would follow the redirect into a second entry, and fetch
|
||||
// drops the #section fragment from a followed redirect anyway.
|
||||
if r.Header.Get("X-Save-Mode") == "replace" {
|
||||
w.Header().Set("X-Target", redirectTarget)
|
||||
w.WriteHeader(http.StatusNoContent)
|
||||
return
|
||||
}
|
||||
http.Redirect(w, r, redirectTarget, http.StatusSeeOther)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user