Skip to content

Commit a2716ef

Browse files
fix: Fix issue where editing source text during website redirection r… (#8046)
1 parent 569aaf3 commit a2716ef

File tree

1 file changed

+1
-7
lines changed

1 file changed

+1
-7
lines changed

agent/app/service/website.go

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2597,19 +2597,13 @@ func (w WebsiteService) GetRedirect(id uint) (res []response.NginxRedirectConfig
25972597
func (w WebsiteService) UpdateRedirectFile(req request.NginxRedirectUpdate) (err error) {
25982598
var (
25992599
website model.Website
2600-
nginxFull dto.NginxFull
26012600
oldRewriteContent []byte
26022601
)
26032602
website, err = websiteRepo.GetFirst(repo.WithByID(req.WebsiteID))
26042603
if err != nil {
26052604
return err
26062605
}
2607-
nginxFull, err = getNginxFull(&website)
2608-
if err != nil {
2609-
return err
2610-
}
2611-
includePath := fmt.Sprintf("/www/sites/%s/redirect/%s.conf", website.Alias, req.Name)
2612-
absolutePath := path.Join(nginxFull.Install.GetPath(), includePath)
2606+
absolutePath := path.Join(GetSitePath(website, SiteRedirectDir), req.Name+".conf")
26132607
fileOp := files.NewFileOp()
26142608
oldRewriteContent, err = fileOp.GetContent(absolutePath)
26152609
if err != nil {

0 commit comments

Comments
 (0)