瀏覽代碼

update code with feedback from hjy

RockyJin 4 年之前
父節點
當前提交
bdbc0c72a2
共有 1 個文件被更改,包括 2 次插入2 次删除
  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)
 	hps.headers = make(map[string]string)
 	if h, ok := props["headers"]; ok {
 	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 {
 			for k, v := range h1 {
 				if v1, ok2 := CastToString(v); ok2 {
 				if v1, ok2 := CastToString(v); ok2 {
-					hps.headers[k.(string)] = v1
+					hps.headers[k] = v1
 				}
 				}
 			}
 			}
 		} else {
 		} else {