Skip to content

Commit

Permalink
Reorder so list is easier to update from AWS
Browse files Browse the repository at this point in the history
  • Loading branch information
MarcEspiard committed Mar 2, 2023
1 parent 521439f commit e55c4dd
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/constructs/aws/SinglePageApp.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ export class SinglePageApp extends StaticWebsiteAbstract {
* Files extensions list taken from: https://docs.aws.amazon.com/amplify/latest/userguide/redirects.html#redirects-for-single-page-web-apps-spa
* Add pdf, xml, webmanifest and avif as well
*/
const code = `var REDIRECT_REGEX = /^[^.]+$|\\.(?!(css|gif|ico|jpg|jpeg|js|png|txt|svg|woff|woff2|ttf|map|json|xml|pdf|webmanifest|webp|avif)$)([^.]+$)/;
const code = `var REDIRECT_REGEX = /^[^.]+$|\\.(?!(css|gif|ico|jpg|jpeg|js|png|txt|svg|woff|woff2|ttf|map|json|webp|xml|pdf|webmanifest|avif)$)([^.]+$)/;
function handler(event) {
var uri = event.request.uri;
Expand Down
4 changes: 2 additions & 2 deletions test/unit/singlePageApp.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ describe("single page app", () => {
Object {
"Properties": Object {
"AutoPublish": true,
"FunctionCode": "var REDIRECT_REGEX = /^[^.]+$|\\\\.(?!(css|gif|ico|jpg|jpeg|js|png|txt|svg|woff|woff2|ttf|map|json|xml|pdf|webmanifest|webp|avif)$)([^.]+$)/;
"FunctionCode": "var REDIRECT_REGEX = /^[^.]+$|\\\\.(?!(css|gif|ico|jpg|jpeg|js|png|txt|svg|woff|woff2|ttf|map|json|webp|xml|pdf|webmanifest|avif)$)([^.]+$)/;
function handler(event) {
var uri = event.request.uri;
Expand Down Expand Up @@ -99,7 +99,7 @@ describe("single page app", () => {
});
const requestFunction = computeLogicalId("landing", "RequestFunction");
expect(cfTemplate.Resources[requestFunction].Properties.FunctionCode).toMatchInlineSnapshot(`
"var REDIRECT_REGEX = /^[^.]+$|\\\\.(?!(css|gif|ico|jpg|jpeg|js|png|txt|svg|woff|woff2|ttf|map|json|xml|pdf|webmanifest|webp|avif)$)([^.]+$)/;
"var REDIRECT_REGEX = /^[^.]+$|\\\\.(?!(css|gif|ico|jpg|jpeg|js|png|txt|svg|woff|woff2|ttf|map|json|webp|xml|pdf|webmanifest|avif)$)([^.]+$)/;
function handler(event) {
var uri = event.request.uri;
Expand Down

0 comments on commit e55c4dd

Please sign in to comment.