@@ -108,20 +108,23 @@ function process(proxyIntegrationConfig, event, context) {
108108}
109109
110110function normalizeRequestPath ( event ) {
111- if ( isLocalExecution ( event ) ) {
112- return event . path ;
113- }
111+ // if (isLocalExecution(event)) {
112+ // return event.path;
113+ // }
114114
115- // ugly hack: if host is from API-Gateway 'Custom Domain Name Mapping', then event.path has the value '/basepath/resource-path/';
116- // if host is from amazonaws.com, then event.path is just '/resource-path':
117- const apiId = event . requestContext ? event . requestContext . apiId : null ; // the apiId that is the first part of the amazonaws.com-host
118- if ( ( apiId && event . headers && event . headers . Host && event . headers . Host . substring ( 0 , apiId . length ) !== apiId ) ) {
119- // remove first path element:
120- const groups = / \/ [ ^ \/ ] + ( .* ) / . exec ( event . path ) || [ null , null ] ;
121- return groups [ 1 ] || '/' ;
122- }
123-
124- return event . path ;
115+ // // ugly hack: if host is from API-Gateway 'Custom Domain Name Mapping', then event.path has the value '/basepath/resource-path/';
116+ // // if host is from amazonaws.com, then event.path is just '/resource-path':
117+ // const apiId = event.requestContext ? event.requestContext.apiId : null; // the apiId that is the first part of the amazonaws.com-host
118+ // if ((apiId && event.headers && event.headers.Host && event.headers.Host.substring(0, apiId.length) !== apiId)) {
119+ // // remove first path element:
120+ // const groups = /\/[^\/]+(.*)/.exec(event.path) || [null, null];
121+ // return groups[1] || '/';
122+ // }
123+
124+ // return event.path;
125+
126+ const groups = / \/ [ ^ \/ ] + ( .* ) / . exec ( event . path ) || [ null , null ] ;
127+ return groups [ 1 ] || '/' ;
125128}
126129
127130function convertError ( error , errorMapping , headers ) {
0 commit comments