(t reflect.Type)
| 248 | } |
| 249 | |
| 250 | func multiPartContentEncoding(t reflect.Type) map[string]*Encoding { |
| 251 | nFields := t.NumField() |
| 252 | encoding := make(map[string]*Encoding, nFields) |
| 253 | for i := range nFields { |
| 254 | f := t.Field(i) |
| 255 | name := formDataFieldName(f) |
| 256 | |
| 257 | contentType := "text/plain" |
| 258 | if f.Type == reflect.TypeFor[FormFile]() || f.Type == reflect.TypeFor[[]FormFile]() { |
| 259 | contentType = f.Tag.Get("contentType") |
| 260 | if contentType == "" { |
| 261 | contentType = "application/octet-stream" |
| 262 | } |
| 263 | } |
| 264 | encoding[name] = &Encoding{ |
| 265 | ContentType: contentType, |
| 266 | } |
| 267 | } |
| 268 | return encoding |
| 269 | } |
no test coverage detected
searching dependent graphs…