(w http.ResponseWriter, data proto.Message)
| 27 | } |
| 28 | |
| 29 | func SendProtoResponse(w http.ResponseWriter, data proto.Message) { |
| 30 | response, _ := proto.Marshal(data) |
| 31 | |
| 32 | w.Header().Set("Content-Type", "application/x-protobuf") |
| 33 | if _, err := w.Write(response); err != nil { |
| 34 | http.Error(w, "Failed to write response", http.StatusInternalServerError) |
| 35 | return |
| 36 | } |
| 37 | } |
| 38 | |
| 39 | func EnsureBase64Password(password string, method string) string { |
| 40 | // First check if it's already a valid base64 string |
no test coverage detected