vendor/github.com/magiconair/properties/load.go
changeset 256 6d9efbef00a9
parent 251 1c52a0eeb952
child 265 05c40b36d3b2
equal deleted inserted replaced
255:4f153a23adab 256:6d9efbef00a9
   130 	if err != nil {
   130 	if err != nil {
   131 		return nil, fmt.Errorf("properties: %s error reading response. %s", url, err)
   131 		return nil, fmt.Errorf("properties: %s error reading response. %s", url, err)
   132 	}
   132 	}
   133 
   133 
   134 	ct := resp.Header.Get("Content-Type")
   134 	ct := resp.Header.Get("Content-Type")
       
   135 	ct = strings.Join(strings.Fields(ct), "")
   135 	var enc Encoding
   136 	var enc Encoding
   136 	switch strings.ToLower(ct) {
   137 	switch strings.ToLower(ct) {
   137 	case "text/plain", "text/plain; charset=iso-8859-1", "text/plain; charset=latin1":
   138 	case "text/plain", "text/plain;charset=iso-8859-1", "text/plain;charset=latin1":
   138 		enc = ISO_8859_1
   139 		enc = ISO_8859_1
   139 	case "", "text/plain; charset=utf-8":
   140 	case "", "text/plain;charset=utf-8":
   140 		enc = UTF8
   141 		enc = UTF8
   141 	default:
   142 	default:
   142 		return nil, fmt.Errorf("properties: invalid content type %s", ct)
   143 		return nil, fmt.Errorf("properties: invalid content type %s", ct)
   143 	}
   144 	}
   144 
   145