Skip to content

Commit

Permalink
Update ConfigEntry.java
Browse files Browse the repository at this point in the history
  • Loading branch information
bit4woo committed Apr 25, 2024
1 parent 9d28dd8 commit 8955a8b
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/config/ConfigEntry.java
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
import com.google.gson.Gson;
import org.apache.commons.lang3.StringUtils;
import runcmd.MessagePart;
import runcmd.TextUtils;

import java.lang.reflect.Field;
import java.lang.reflect.Modifier;
Expand Down Expand Up @@ -139,6 +138,7 @@ public String getType() {

public void setType(String type) {
this.type = type;
autoComment(type);
}

public boolean isEnable() {
Expand Down Expand Up @@ -396,20 +396,20 @@ public void takeEditAction(int toolFlag, boolean messageIsRequest, IHttpRequestR
switch (type) {
case Action_Add_Or_Replace_Header:
case Action_If_Base_URL_Matches_Add_Or_Replace_Header:
getter.addOrUpdateHeader(messageIsRequest, messageInfo, configKey, configValue);
getter.addOrUpdateHeader(true, messageInfo, configKey, configValue);
//注意,单个分支应该break。
break;
case Action_Append_To_header_value:
case Action_If_Base_URL_Matches_Append_To_header_value:
String oldValue = getter.getHeaderValueOf(messageIsRequest, messageInfo, configKey);
String oldValue = getter.getHeaderValueOf(true, messageInfo, configKey);
if (oldValue == null) {
oldValue = "";
}
getter.addOrUpdateHeader(messageIsRequest, messageInfo, configKey, oldValue + configValue);
getter.addOrUpdateHeader(true, messageInfo, configKey, oldValue + configValue);
break;
case Action_Remove_From_Headers:
case Action_If_Base_URL_Matches_Remove_From_Headers:
getter.removeHeader(messageIsRequest, messageInfo, configKey);
getter.removeHeader(true, messageInfo, configKey);
break;
}
}
Expand Down

0 comments on commit 8955a8b

Please sign in to comment.