mirror of
https://github.com/Threnklyn/wg-ui.git
synced 2026-05-30 02:28:27 +02:00
Add filename + download disposition for when downloading config
This commit is contained in:
@@ -419,6 +419,8 @@ func (s *Server) GetClient(w http.ResponseWriter, r *http.Request, ps httprouter
|
||||
|
||||
format := r.URL.Query().Get("format")
|
||||
if format == "config" {
|
||||
filename := fmt.Sprintf("%s.conf", client.Name)
|
||||
w.Header().Set("Content-Disposition", fmt.Sprintf("attachment; filename=\"%s\"", filename))
|
||||
w.WriteHeader(http.StatusOK)
|
||||
|
||||
allowedIPs := strings.Join(*wgAllowedIPs, ",")
|
||||
|
||||
Reference in New Issue
Block a user