fix(tasks): limit titles and display descriptions
This commit is contained in:
1 parent
1b8abd3509
commit
dcc201e7bb
6 files changed
+117
-76
No files matched your search
@@ -8,6 +8,7 @@ import (
|
||||
"io"
|
||||
"net/http"
|
||||
"strings"
|
||||
"unicode/utf8"
|
||||
|
||||
"google.golang.org/grpc/codes"
|
||||
"google.golang.org/grpc/status"
|
||||
@@ -94,6 +95,10 @@ func (s *Server) handleWorkRequest(w http.ResponseWriter, r *http.Request) {
|
||||
http.Error(w, "identity, workflow, title, and instructions are required", http.StatusBadRequest)
|
||||
return
|
||||
}
|
||||
if utf8.RuneCountInString(request.Title) > 80 {
|
||||
http.Error(w, "title must be 80 characters or fewer; put details in instructions", http.StatusBadRequest)
|
||||
return
|
||||
}
|
||||
iface, code, err := s.workRequestInterface(r.Context(), request)
|
||||
if err != nil {
|
||||
http.Error(w, err.Error(), code)
|
||||
|
||||
Reference in new issue
Block a user