Rod Hynes 9 лет назад
Родитель
Сommit
398edd8b1f
2 измененных файлов с 2 добавлено и 3 удалено
  1. 2 2
      psiphon/server/api.go
  2. 0 1
      psiphon/server/webServer.go

+ 2 - 2
psiphon/server/api.go

@@ -587,7 +587,7 @@ func getJSONObjectRequestParam(params requestJSONObject, name string) (requestJS
 	if params[name] == nil {
 		return nil, common.ContextError(fmt.Errorf("missing param: %s", name))
 	}
-	// TODO: can't use requestJSONObject type?
+	// Note: generic unmarshal of JSON produces map[string]interface{}, not requestJSONObject
 	value, ok := params[name].(map[string]interface{})
 	if !ok {
 		return nil, common.ContextError(fmt.Errorf("invalid param: %s", name))
@@ -606,7 +606,7 @@ func getJSONObjectArrayRequestParam(params requestJSONObject, name string) ([]re
 
 	result := make([]requestJSONObject, len(value))
 	for i, item := range value {
-		// TODO: can't use requestJSONObject type?
+		// Note: generic unmarshal of JSON produces map[string]interface{}, not requestJSONObject
 		resultItem, ok := item.(map[string]interface{})
 		if !ok {
 			return nil, common.ContextError(fmt.Errorf("invalid param: %s", name))

+ 0 - 1
psiphon/server/webServer.go

@@ -194,7 +194,6 @@ func convertHTTPRequestToAPIRequest(
 		if err != nil {
 			return nil, common.ContextError(err)
 		}
-		// TODO: can't use requestJSONObject type?
 		var bodyParams map[string]interface{}
 		err = json.Unmarshal(body, &bodyParams)
 		if err != nil {