mirror of
https://github.com/MHSanaei/3x-ui.git
synced 2026-06-28 00:24:19 +00:00
feat(backup): prefer browser request host for backup filename
Name downloaded DB backups after the host shown in the panel title (c.Request.Host) when available, falling back to the configured web domain and then the public IP. Telegram-sent backups have no request context and keep the domain/IP behavior.
This commit is contained in:
@@ -298,7 +298,7 @@ func (a *ServerController) getDb(c *gin.Context) {
|
||||
return
|
||||
}
|
||||
|
||||
filename := a.serverService.BackupFilename()
|
||||
filename := a.serverService.BackupFilename(c.Request.Host)
|
||||
if !filenameRegex.MatchString(filename) {
|
||||
c.AbortWithError(http.StatusBadRequest, fmt.Errorf("invalid filename"))
|
||||
return
|
||||
|
||||
Reference in New Issue
Block a user