反向代理支持RequestPath、RequestURI等

This commit is contained in:
刘祥超
2020-09-27 10:03:05 +08:00
parent 08f0788349
commit f78072df0c
3 changed files with 22 additions and 7 deletions

View File

@@ -122,14 +122,14 @@ func (this *ReverseProxyService) UpdateReverseProxyBackupOrigins(ctx context.Con
}
// 修改是否启用
func (this *ReverseProxyService) UpdateReverseProxyIsOn(ctx context.Context, req *pb.UpdateReverseProxyIsOnRequest) (*pb.RPCUpdateSuccess, error) {
func (this *ReverseProxyService) UpdateReverseProxy(ctx context.Context, req *pb.UpdateReverseProxyRequest) (*pb.RPCUpdateSuccess, error) {
// 校验请求
_, _, err := rpcutils.ValidateRequest(ctx, rpcutils.UserTypeAdmin)
if err != nil {
return nil, err
}
err = models.SharedReverseProxyDAO.UpdateReverseProxyIsOn(req.ReverseProxyId, req.IsOn)
err = models.SharedReverseProxyDAO.UpdateReverseProxy(req.ReverseProxyId, req.RequestHost, req.RequestURI, req.StripPrefix)
if err != nil {
return nil, err
}