handleCursor returns the current server time as a cursor token. E2E tests grab the cursor before triggering an action, then pass it as `since` to the search / wait endpoints to avoid picking up stale messages.
()
| 52 | // E2E tests grab the cursor before triggering an action, then pass it as |
| 53 | // `since` to the search / wait endpoints to avoid picking up stale messages. |
| 54 | func handleCursor() http.HandlerFunc { |
| 55 | return func(w http.ResponseWriter, r *http.Request) { |
| 56 | cursor := time.Now().UTC().Format(time.RFC3339Nano) |
| 57 | smtpJSON(w, map[string]string{"cursor": cursor}) |
| 58 | } |
| 59 | } |
| 60 | |
| 61 | // handleMessages returns SMTP messages matching the given filter. |
| 62 | func handleMessages(store event.Store) http.HandlerFunc { |
no test coverage detected