Is it possible to use axum behind an aws gateway for file uploads to s3? #739
Replies: 1 comment
-
I was using aws rest api gateway but chaning to http solved all my problems. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Im trying to upload a png image to s3 as folows: gateway > lambda > s3, and im using axum on the lambda. Everything seems to work fine locally outside of the lambda runtime but as soon as i deploy and the lambda receives the body from the gateway the image gets encoded and cant be viewed from s3.
I've tried to set binary media types to : image/png and the integration to normal and convert_to_binary.
This is the result bytes i get in axum. The gateway seem to base64 the image but parts of it gets corrupted(?).
red 10x10 png
77+9UE5HDQoaCgAAAA1JSERSAAAACgAAAAoIAgAAAAJQWO+/vQAAAe+/vWlDQ1BJQ0MgcHJvZmlsZQAAKO+/vX3vv709SO+/vUAc77+9X1vvv73vv70VBzvvv70U77+9UDtZEBVx77+9KhTvv71C77+9FVp1MO+/ve+/vQvvv700JCku77+977+9a++/ve+/ve+/vcWq77+977+977+977+9Du+/ve+/vSDvv70B77+977+977+977+9IiXvv70vKe+/ve+/ve+/ve+/vR/vv73vv70977+977+9Ae+/vUbvv73vv71m77+9OO+/vWrvv73vv71OJu+/vWxuVQjvv73vv70PEe+/vRDDiO+/vUx9ThRT77+9HF/vv73vv73vv73vv70uzrPvv73vv73vv70577+977+977+977+9AO+/vUA877+9dO+/vSLvv70g77+93rR077+977+977+9YVbvv70U77+9c++/vTHvv70uSO+/ve+/vXXvv73vv70377+9Re+/ve+/vTwzbGTvv73vv73vv71hYu+/ve+/ve+/vXIH77+977+977+9Ek8RRxVV77+9fH/vv71l77+977+9Fmfvv71SY++/vXvvv70X77+977+977+977+9Mu+/vWlG77+977+9Iu+/vSBC77+977+9Gsqo77+9Qu+/vVbvv70UE2nvv71PeO+/ve+/vR3vv71ILu+/vVxlMHIs77+9ChXvv73vv70H77+977+977+93Zrvv73vv70JNynvv70A77+9X2zvv71jFAjvv70Czbptfx/vv71277+9BAg8A1da77+9X20AM++/ve+/ve+/ve+/vVrvv70IGO+/vQYu77+925rvv70HXO+/vQBDT++/vWRI77+9FO+/ve+/vS8U77+977+9M++/ve+/vRwweAvvv73vv73vv73vv73vv73vv71x77+9AGTvv73vv73vv70NcHAIxIrvv73vv73vv73vv73vv73vv73vv73vv70977+977+977+9B++/vUty77+9Yw3vv70AAAAJcEhZcwAALiMAAC4jAXjvv70/dgAAAAd0SU1FB++/vQscDCcm77+9WO+/vVAAAAAZdEVYdENvbW1lbnQAQ3JlYXRlZCB3aXRoIEdJTVBX77+9DhcAAAASSURBVBjvv71j77+9z4APMDHvv71KYwEAQSwBE2ViEDMAAAAASUVORO+/vUJg77+9axum handler
async fn handle_static( bytes: Bytes ) -> impl IntoResponse { bytes }Beta Was this translation helpful? Give feedback.
All reactions