mirror of
https://github.com/TeaOSLab/EdgeAPI.git
synced 2025-11-15 09:10:24 +08:00
修复修改HTTP Header不会自动更新节点配置的Bug
This commit is contained in:
@@ -147,6 +147,32 @@ func (this *HTTPWebService) UpdateHTTPWebCompression(ctx context.Context, req *p
|
||||
return this.Success()
|
||||
}
|
||||
|
||||
// UpdateHTTPWebWebP 修改WebP配置
|
||||
func (this *HTTPWebService) UpdateHTTPWebWebP(ctx context.Context, req *pb.UpdateHTTPWebWebPRequest) (*pb.RPCSuccess, error) {
|
||||
// 校验请求
|
||||
_, userId, err := this.ValidateAdminAndUser(ctx, 0, 0)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
if userId > 0 {
|
||||
// 检查用户权限
|
||||
err = models.SharedHTTPWebDAO.CheckUserWeb(nil, userId, req.WebId)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
}
|
||||
|
||||
tx := this.NullTx()
|
||||
|
||||
err = models.SharedHTTPWebDAO.UpdateWebWebP(tx, req.WebId, req.WebpJSON)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
return this.Success()
|
||||
}
|
||||
|
||||
// UpdateHTTPWebCharset 修改字符集配置
|
||||
func (this *HTTPWebService) UpdateHTTPWebCharset(ctx context.Context, req *pb.UpdateHTTPWebCharsetRequest) (*pb.RPCSuccess, error) {
|
||||
// 校验请求
|
||||
|
||||
Reference in New Issue
Block a user