Remnawave_migrate/util/http_utils.go
Sergey Kutovoy d459ffa8f4
Improve code consistency and organization
- Move header parsing to dedicated util/http_utils.go file
- Fix indentation issues in marzneshin.go
- Remove unused getEnvOrArg function
- Make HTTP header handling consistent across all API clients
- Standardize README formatting with consistent bullet points
- Improve documentation for custom headers feature
- Fix table formatting in documentation

These changes maintain all functionality while improving code organization,
readability, and consistency throughout the codebase.
2025-05-14 15:31:55 +05:00

21 lines
357 B
Go

package util
import (
"strings"
)
func ParseHeaderMap(raw string) map[string]string {
headers := make(map[string]string)
if raw == "" {
return headers
}
for _, pair := range strings.Split(raw, ",") {
kv := strings.SplitN(pair, ":", 2)
if len(kv) == 2 {
headers[strings.TrimSpace(kv[0])] = strings.TrimSpace(kv[1])
}
}
return headers
}