Right now I'm having this weird issue, I have a POST endpoint /api/upload
and if I send a request with curl it gets handled like 4 times
curl -X POST -H "content-type: multipart/form-data" 127.0.0.1:3000/api/upload -F "key=lol" -F "image=@xyz.png"
debug print: http://shekels.wtf/i/7d2b8f6cd894.meme.png
@alice Can you provide some code?
What would you need to see? @weavejester
I wouldn't know what to send
as far as I know the whole implementation is very standard
and I wouldn't wanna spam the entire project here
Alright, using my besst judgement I guess it's really just two functions
(context "/api" []
(POST "/upload" {params :params} (upload params)))
(defn upload [request]
(println "thing called"))
and it'll print twice
Yeah, upload
is ONLY referenced in that bit there
it always prints two times
the request is only handled once afaik but the route wants to happen twice
@alice It might be related to the lack of an explicit return value. println
returns nil
, and in Compojure, a return value of nil
from a route means “this route didn’t match, try the next one”. Try returning a valid response from the route and see if that fixes it.