Open choonkeat opened 6 years ago
http.ResponseWriter
unfortunately, some lambda platforms (e.g. google cloud) gives very specific url
i.e.
https://xyz.cloudfunctions.net/attache
will hit your lambda function, but
https://xyz.cloudfunctions.net/attache/abc
will NOT hit your lambda function; returns 404
so in order for us to retrieve images like
https://xyz.cloudfunctions.net/attache/resize/100x/987654321.gif
we'd need to specify instead as,
https://xyz.cloudfunctions.net/attache?resize/100x/987654321.gif
and do some strings.TrimPrefix(r.URL.RequestURI(), "/attache?") to obtain the "resize/100x/987654321.gif"
strings.TrimPrefix(r.URL.RequestURI(), "/attache?")
"resize/100x/987654321.gif"
http.ResponseWriter
(no processing)unfortunately, some lambda platforms (e.g. google cloud) gives very specific url
i.e.
will hit your lambda function, but
will NOT hit your lambda function; returns 404
so in order for us to retrieve images like
we'd need to specify instead as,
and do some
strings.TrimPrefix(r.URL.RequestURI(), "/attache?")
to obtain the"resize/100x/987654321.gif"