Skip to content

Commit b512cc5

Browse files
committed
Fix input when xhttp extra is empty
Signed-off-by: Loren Eteval <[email protected]>
1 parent 47ad61e commit b512cc5

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

Furious/Widget/GuiVTransport.py

+8-2
Original file line numberDiff line numberDiff line change
@@ -837,7 +837,10 @@ def inputToFactory(self, config: ConfigurationFactory) -> bool:
837837
xhttpObject = streamSettings['xhttpSettings']
838838

839839
try:
840-
oldExtra = UJSONEncoder.encode(xhttpObject.get('extra', ''))
840+
if xhttpObject.get('extra', ''):
841+
oldExtra = UJSONEncoder.encode(xhttpObject.get('extra', ''))
842+
else:
843+
oldExtra = ''
841844
except Exception:
842845
# Any non-exit exceptions
843846

@@ -872,7 +875,10 @@ def factoryToInput(self, config: ConfigurationFactory):
872875
try:
873876
xhttpObject = getXrayProxyOutboundStream(config)['xhttpSettings']
874877

875-
self.setText(UJSONEncoder.encode(xhttpObject.get('extra', '')))
878+
if xhttpObject.get('extra', ''):
879+
self.setText(UJSONEncoder.encode(xhttpObject.get('extra', '')))
880+
else:
881+
self.setText('')
876882
except Exception:
877883
# Any non-exit exceptions
878884

0 commit comments

Comments
 (0)