File tree Expand file tree Collapse file tree 1 file changed +10
-4
lines changed
localstack-core/localstack/services Expand file tree Collapse file tree 1 file changed +10
-4
lines changed Original file line number Diff line number Diff line change @@ -108,12 +108,18 @@ def dispatch_to_moto(context: RequestContext) -> Response:
108108 service = context .service
109109 request = context .request
110110
111- raw_path = get_full_raw_path (request )
111+ # Werkzeug might have an issue (to be determined where the responsibility lies) with proxied requests where the
112+ # HTTP location is a full URI and not only a path.
113+ # We need to use the full_raw_url as moto does some path decoding (in S3 for example)
114+ full_raw_path = get_full_raw_path (request )
115+ # remove the query string from the full path to do the matching of the request
116+ raw_path_only = full_raw_path .split ("?" )[0 ]
112117 # this is where we skip the HTTP roundtrip between the moto server and the boto client
113- dispatch = get_dispatcher (service .service_name , raw_path . split ( "?" )[ 0 ] )
118+ dispatch = get_dispatcher (service .service_name , raw_path_only )
114119 try :
115- # we use the full_raw_url as moto might do some path decoding (in S3 for example)
116- raw_url = get_raw_current_url (request .scheme , request .host , request .root_path , raw_path )
120+ raw_url = get_raw_current_url (
121+ request .scheme , request .host , request .root_path , full_raw_path
122+ )
117123 response = dispatch (request , raw_url , request .headers )
118124 if not response :
119125 # some operations are only partially implemented by moto
You can’t perform that action at this time.
0 commit comments