Skip to content

Commit

Permalink
Adding Conditions to Handle 404 redirect_code for Invalid Urls and Ad…
Browse files Browse the repository at this point in the history
…ding condition to handle Valid PWA URLs as well. (#4357)
  • Loading branch information
del15881 authored Jan 15, 2025
1 parent 8087fe0 commit 907ccba
Showing 1 changed file with 31 additions and 1 deletion.
32 changes: 31 additions & 1 deletion packages/venia-ui/upward.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,12 @@ veniaResponse:
- matches: urlResolver.redirect_code
pattern: '(301|302)'
use: dynamicRedirect
- matches: request.url.pathname
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)$'
use: veniaAppShell
- matches: urlResolver.redirect_code
pattern: '(404)'
use: notFoundResponse
default: veniaAppShell

# A FileResolver for serving certain files directly from document root,
Expand Down Expand Up @@ -255,4 +261,28 @@ dynamicRedirect:
resolver: file
file:
resolver: inline
inline: './index.html'
inline: './index.html'

notFoundResponse:
resolver: inline
inline:
status: urlResolver.redirect_code
headers:
resolver: inline
inline:
content-type:
inline: text/html
cache-control:
inline: s-maxage=60
body:
resolver: template
engine: mustache
provide:
pageType: veniaPageType.data
pageTypeNonce: veniaPageTypeNonce.nonce
webpackChunks: veniaWebpackChunks.scripts
template:
resolver: file
file:
resolver: inline
inline: './index.html'

0 comments on commit 907ccba

Please sign in to comment.