summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--exports/exports.go9
-rw-r--r--wrappers/python/src/main.py7
2 files changed, 10 insertions, 6 deletions
diff --git a/exports/exports.go b/exports/exports.go
index 468c5a4..aa2b40e 100644
--- a/exports/exports.go
+++ b/exports/exports.go
@@ -109,18 +109,19 @@ func CancelOAuth(name *C.char) *C.char {
}
type configJSON struct {
- config string `json:"config"`
- configType string `json:"config_type"`
+ Config string `json:"config"`
+ ConfigType string `json:"config_type"`
}
func getConfigJSON(config string, configType string) *C.char {
- json, jsonErr := json.Marshal(&configJSON{config, configType})
+ object := &configJSON{Config: config, ConfigType: configType}
+ jsonBytes, jsonErr := json.Marshal(object)
if jsonErr != nil {
panic(jsonErr)
}
- return C.CString(string(json))
+ return C.CString(string(jsonBytes))
}
//export GetConfigSecureInternet
diff --git a/wrappers/python/src/main.py b/wrappers/python/src/main.py
index 6f4b140..4868fca 100644
--- a/wrappers/python/src/main.py
+++ b/wrappers/python/src/main.py
@@ -2,6 +2,7 @@ from . import lib, VPNStateChange, encode_args, decode_res
from typing import Optional, Tuple
import threading
from .event import StateType, EventHandler
+import json
eduvpn_objects = {}
@@ -110,8 +111,10 @@ class EduVPN(object):
if config_err:
raise Exception(config_err)
- config = config_json["config"]
- config_type = config_json["config_type"]
+
+ config_json_dict = json.loads(config_json)
+ config = config_json_dict["config"]
+ config_type = config_json_dict["config_type"]
return config, config_type