intor 2.4.5 → 2.4.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -17,7 +17,6 @@ import { getLocaleFromAcceptLanguage } from '../../../routing/locale/get-locale-
|
|
|
17
17
|
*/
|
|
18
18
|
function createIntorHandler(config) {
|
|
19
19
|
return async function intorHandler({ event, resolve }) {
|
|
20
|
-
const { host, searchParams, pathname: rawPathname } = event.url;
|
|
21
20
|
// Locale from Accept-Language header
|
|
22
21
|
const acceptLanguage = event.request.headers.get("accept-language");
|
|
23
22
|
const localeFromAcceptLanguage = getLocaleFromAcceptLanguage(acceptLanguage, config.supportedLocales);
|
|
@@ -29,11 +28,12 @@ function createIntorHandler(config) {
|
|
|
29
28
|
inboundResult = {
|
|
30
29
|
locale: event.params?.locale,
|
|
31
30
|
localeSource: "path",
|
|
32
|
-
pathname:
|
|
31
|
+
pathname: event.url.pathname,
|
|
33
32
|
shouldRedirect: false,
|
|
34
33
|
};
|
|
35
34
|
}
|
|
36
35
|
else {
|
|
36
|
+
const { host, searchParams, pathname: rawPathname } = event.url;
|
|
37
37
|
inboundResult = await resolveInbound(config, rawPathname, {
|
|
38
38
|
host,
|
|
39
39
|
query: normalizeQuery(Object.fromEntries(searchParams.entries())),
|