Ver código fonte

update code with feedback from hjy

RockyJin 4 anos atrás
pai
commit
bdbc0c72a2
1 arquivos alterados com 2 adições e 2 exclusões
  1. 2 2
      xstream/extensions/httppull_source.go

+ 2 - 2
xstream/extensions/httppull_source.go

@@ -101,10 +101,10 @@ func (hps *HTTPPullSource) Configure(device string, props map[string]interface{}
 
 	hps.headers = make(map[string]string)
 	if h, ok := props["headers"]; ok {
-		if h1, ok1 := h.(map[interface{}]interface{}); ok1 {
+		if h1, ok1 := h.(map[string]interface{}); ok1 {
 			for k, v := range h1 {
 				if v1, ok2 := CastToString(v); ok2 {
-					hps.headers[k.(string)] = v1
+					hps.headers[k] = v1
 				}
 			}
 		} else {