Updated the Localized HTML Collection response in the Infrastructure package to make Vary: Accept-Language opt-in for localized responses.
This commit is contained in:
@@ -9,9 +9,11 @@ import Localization
|
||||
/// `Accept-Language` header, negotiates the best supported match (falling back to the default language), and stores it on the context's
|
||||
/// ``LocalizedRequestContext/language``.
|
||||
///
|
||||
/// The query parameter is the deliberate override a language switcher links to; failing that, a leading path segment naming a supported language
|
||||
/// pins it, so an unrouted path under a language's prefix — its not-found page — answers in that language. Values naming no supported language
|
||||
/// are ignored, leaving the header. The request is passed through untouched — the path and routing are unaffected.
|
||||
/// The query parameter is a deliberate override; failing that, a leading path segment naming a supported language pins it, so an unrouted path under
|
||||
/// a language's prefix — its not-found page — answers in that language. Values naming no supported language are ignored, leaving the header. The
|
||||
/// request is passed through untouched — the path and routing are unaffected.
|
||||
///
|
||||
/// A site whose page routes pin their language by URL consults this only for responses that belong to no URL — in practice, its not-found page.
|
||||
public struct LocalizationMiddleware<Context: LocalizedRequestContext> {
|
||||
|
||||
// MARK: Properties
|
||||
|
||||
Reference in New Issue
Block a user