Skip to content

Commit 5828b99

Browse files
committed
Merge branch 'master' of github.com:logandk/serverless-wsgi
2 parents 2f27a68 + cc3cec3 commit 5828b99

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

serverless_wsgi.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -254,6 +254,12 @@ def handle_payload_v2(app, event, context):
254254
script_name = get_script_name(headers, event.get("requestContext", {}))
255255

256256
path_info = strip_express_gateway_query_params(event["rawPath"])
257+
base_path = os.environ.get("API_GATEWAY_BASE_PATH")
258+
if base_path:
259+
script_name = "/" + base_path
260+
261+
if path_info.startswith(script_name):
262+
path_info = path_info[len(script_name) :]
257263

258264
body = event.get("body", "")
259265
body = get_body_bytes(event, body)

0 commit comments

Comments
 (0)