Skip to content

Commit 907ccba

Browse files
authored
Adding Conditions to Handle 404 redirect_code for Invalid Urls and Adding condition to handle Valid PWA URLs as well. (#4357)
1 parent 8087fe0 commit 907ccba

File tree

1 file changed

+31
-1
lines changed

1 file changed

+31
-1
lines changed

packages/venia-ui/upward.yml

Lines changed: 31 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,12 @@ veniaResponse:
2323
- matches: urlResolver.redirect_code
2424
pattern: '(301|302)'
2525
use: dynamicRedirect
26+
- matches: request.url.pathname
27+
pattern: '^/(account-information|address-book|cart|checkout|communications|sign-in|contact-us|create-account|forgot-password|order-confirmation|order-history|customer/account/createPassword|saved-payments|search\.html|wishlist)$'
28+
use: veniaAppShell
29+
- matches: urlResolver.redirect_code
30+
pattern: '(404)'
31+
use: notFoundResponse
2632
default: veniaAppShell
2733

2834
# A FileResolver for serving certain files directly from document root,
@@ -255,4 +261,28 @@ dynamicRedirect:
255261
resolver: file
256262
file:
257263
resolver: inline
258-
inline: './index.html'
264+
inline: './index.html'
265+
266+
notFoundResponse:
267+
resolver: inline
268+
inline:
269+
status: urlResolver.redirect_code
270+
headers:
271+
resolver: inline
272+
inline:
273+
content-type:
274+
inline: text/html
275+
cache-control:
276+
inline: s-maxage=60
277+
body:
278+
resolver: template
279+
engine: mustache
280+
provide:
281+
pageType: veniaPageType.data
282+
pageTypeNonce: veniaPageTypeNonce.nonce
283+
webpackChunks: veniaWebpackChunks.scripts
284+
template:
285+
resolver: file
286+
file:
287+
resolver: inline
288+
inline: './index.html'

0 commit comments

Comments
 (0)