File tree Expand file tree Collapse file tree 1 file changed +3
-2
lines changed
Expand file tree Collapse file tree 1 file changed +3
-2
lines changed Original file line number Diff line number Diff line change 66 "fmt"
77 "net/http"
88 "strconv"
9+ "strings"
910 "time"
1011
1112 "github.com/labstack/echo/v4"
@@ -209,7 +210,7 @@ func v1_insert_item(c echo.Context) error {
209210
210211 var item_id_type , item_status , item_status_type , payload string
211212
212- if c .Request ().Header .Get (echo .HeaderContentType ) == echo .MIMEApplicationJSON {
213+ if strings . HasPrefix ( strings . ToLower ( c .Request ().Header .Get (echo .HeaderContentType )), echo .MIMEApplicationJSON ) {
213214 item := Item {}
214215 if err := c .Bind (& item ); err != nil {
215216 return c .JSON (http .StatusBadRequest , echo.Map {"error" : err .Error ()})
@@ -262,7 +263,7 @@ func v1_insert_item(c echo.Context) error {
262263 }
263264 document [ID ] = item_id_int
264265 default :
265- return c .JSON (http .StatusBadRequest , echo.Map {"error" : "Invalid task_id_type" })
266+ return c .JSON (http .StatusBadRequest , echo.Map {"error" : "Invalid task_id_type" , "item_id_type" : item_id_type })
266267 }
267268 // status
268269 switch item_status_type {
You can’t perform that action at this time.
0 commit comments