mirror of
https://gitee.com/rainbond/Rainbond.git
synced 2024-12-02 19:57:42 +08:00
Merge pull request #863 from GLYASAI/issue-858
New Feature: make proxy_buffer_size and proxy_buffer_numbers configurable
This commit is contained in:
commit
6f1ca23263
@ -643,6 +643,16 @@ func (g *GatewayAction) RuleConfig(req *apimodel.RuleConfigReq) error {
|
||||
Key: "proxy-body-size",
|
||||
Value: strconv.Itoa(req.Body.ProxyBodySize),
|
||||
})
|
||||
configs = append(configs, &model.GwRuleConfig{
|
||||
RuleID: req.RuleID,
|
||||
Key: "proxy-buffer-size",
|
||||
Value: strconv.Itoa(req.Body.ProxyBufferSize) + "k",
|
||||
})
|
||||
configs = append(configs, &model.GwRuleConfig{
|
||||
RuleID: req.RuleID,
|
||||
Key: "proxy-buffer-numbers",
|
||||
Value: strconv.Itoa(req.Body.ProxyBufferNumbers),
|
||||
})
|
||||
setheaders := make(map[string]string)
|
||||
for _, item := range req.Body.SetHeaders {
|
||||
if strings.TrimSpace(item.Key) == "" {
|
||||
@ -661,10 +671,12 @@ func (g *GatewayAction) RuleConfig(req *apimodel.RuleConfigReq) error {
|
||||
Value: v,
|
||||
})
|
||||
}
|
||||
|
||||
rule, err := g.dbmanager.HTTPRuleDao().GetHTTPRuleByID(req.RuleID)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
tx := db.GetManager().Begin()
|
||||
defer func() {
|
||||
if r := recover(); r != nil {
|
||||
@ -686,6 +698,7 @@ func (g *GatewayAction) RuleConfig(req *apimodel.RuleConfigReq) error {
|
||||
tx.Rollback()
|
||||
return err
|
||||
}
|
||||
|
||||
if err := g.SendTask(map[string]interface{}{
|
||||
"service_id": req.ServiceID,
|
||||
"action": "update-rule-config",
|
||||
|
@ -129,6 +129,8 @@ type Body struct {
|
||||
ProxyBodySize int `json:"proxy_body_size,omitempty" validate:"proxy_body_size|required"`
|
||||
SetHeaders []*SetHeader `json:"set_headers,omitempty" `
|
||||
Rewrites []*Rewrite `json:"rewrite,omitempty"`
|
||||
ProxyBufferSize int `json:"proxy_buffer_size,omitempty"`
|
||||
ProxyBufferNumbers int `json:"proxy_buffer_numbers,omitempty"`
|
||||
}
|
||||
|
||||
//SetHeader set header
|
||||
|
@ -4,11 +4,7 @@ set -o errexit
|
||||
# define package name
|
||||
WORK_DIR=/go/src/github.com/goodrain/rainbond
|
||||
BASE_NAME=rainbond
|
||||
IMAGE_BASE_NAME=rainbond
|
||||
if [ $BUILD_IMAGE_BASE_NAME ];
|
||||
then
|
||||
IMAGE_BASE_NAME=${BUILD_IMAGE_BASE_NAME}
|
||||
fi
|
||||
IMAGE_BASE_NAME=${BUILD_IMAGE_BASE_NAME:-'rainbond'}
|
||||
|
||||
GO_VERSION=1.13
|
||||
GATEWAY_GO_VERSION=1.13-alpine
|
||||
|
Loading…
Reference in New Issue
Block a user