(i *textinput.Model)
| 169 | } |
| 170 | |
| 171 | func correctHeader(i *textinput.Model) { |
| 172 | // TODO use regexp instead |
| 173 | h := i.Value() |
| 174 | h = textproto.TrimString(h) |
| 175 | h = strings.ReplaceAll(h, " ", "-") |
| 176 | h = http.CanonicalHeaderKey(h) |
| 177 | |
| 178 | // auto correct header name |
| 179 | i.SetValue(h) |
| 180 | } |
| 181 | |
| 182 | func headersPrintf(h http.Header) []string { |
| 183 | var order, lines []string |