File tree Expand file tree Collapse file tree
pages/options/sections/rules/edit/form-content Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -84,6 +84,7 @@ const Execution = () => {
8484 { /* Custom function */ }
8585 { ( isFunction || ruleType === RULE_TYPE . MODIFY_RECV_BODY ) && (
8686 < CodeEditorField
87+ key = { isFunction ? 'code' : 'body.value' }
8788 field = { isFunction ? 'code' : 'body.value' }
8889 label = { t ( isFunction ? 'code' : 'response_content' ) }
8990 height = "200px"
Original file line number Diff line number Diff line change @@ -118,21 +118,22 @@ export function upgradeRuleFormat(s: OldRule) {
118118 s . ruleType === 'modifyReceiveHeader' ) &&
119119 ! s . isFunction
120120 ) {
121- if ( ! s . headers && s . action ) {
121+ if ( ! s . headers && typeof s . action === 'object' ) {
122122 const { name, value } = s . action as RULE_ACTION_OBJ ;
123123 s . headers = {
124124 [ name ] : value ,
125125 } ;
126- delete s . action ;
127- }
128- if ( typeof s . headers === 'object' ) {
129- s . headers = Object . fromEntries (
130- Object . entries ( s . headers ) . map ( ( [ key , value ] ) => [
131- key . toLowerCase ( ) ,
132- value ,
133- ] ) ,
134- ) ;
135126 }
127+ delete s . action ;
128+ }
129+
130+ if ( typeof s . headers === 'object' ) {
131+ s . headers = Object . fromEntries (
132+ Object . entries ( s . headers ) . map ( ( [ key , value ] ) => [
133+ key . toLowerCase ( ) ,
134+ value ,
135+ ] ) ,
136+ ) ;
136137 }
137138
138139 if ( ! s . condition ) {
You can’t perform that action at this time.
0 commit comments