aws-architect 6.7.99 → 6.7.102
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/server.js +2 -2
- package/package.json +1 -1
package/lib/server.js
CHANGED
|
@@ -212,11 +212,11 @@ function Server(contentDirectory, lambdaApi, logger) {
|
|
|
212
212
|
|
|
213
213
|
const responseHeaders = cloneDeep(response.headers || {});
|
|
214
214
|
Object.keys(responseHeaders).filter(h => h.match(/location/i)).forEach(header => {
|
|
215
|
-
responseHeaders[header] = responseHeaders[header]
|
|
215
|
+
responseHeaders[header] = `${responseHeaders[header]}`.replace(/^https?:\/\/(localhost:\d{2,5})\/(.*)$/g, 'http://$1/api/$2');
|
|
216
216
|
});
|
|
217
217
|
const multiValueHeaders = cloneDeep(response.multiValueHeaders || {});
|
|
218
218
|
Object.keys(multiValueHeaders).filter(h => multiValueHeaders[h]).forEach(h => {
|
|
219
|
-
responseHeaders[h] = multiValueHeaders[h].filter(v => v).map(v => v
|
|
219
|
+
responseHeaders[h] = multiValueHeaders[h].filter(v => v).map(v => `${v}`.replace(/^https?:\/\/(localhost:\d{2,5})\/(.*)$/g, 'http://$1/api/$2'));
|
|
220
220
|
});
|
|
221
221
|
|
|
222
222
|
if (Array.isArray(responseHeaders['Content-Type'])) {
|