Localized paths + sending the locale to a backend. Where do I have to validate it? #1834
-
This could be relatively naive set of questions, but lets see. In the examples, it seems that the locale being passed into the locale segment is only really validated in layout.tsx. This is what we are doing. We have made an assumption therefore that the locale would be valid in a page.tsx server side component that uses that layout, and since we have some backend translations in our database, we send the locale to our backend so we can pull the right strings. However, while we were under some kind of probing attack and I noticed that our backend was receiving locales that made no sense, essentially filenames or other random seeming strings. So it turns out that even when Does this make sense at all? If so, should we then be validating the locale in more than the root layout? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 2 replies
-
I think this should help to answer your question: #1722 (comment) |
Beta Was this translation helpful? Give feedback.
I think this should help to answer your question: #1722 (comment)