πΏ Minor Changes
- #17262
f8e9458Thanks @Princesseuh! - Adds an@astrojs/internal-helpers/mdxentrypoint with the shared helpers the Markdown processor packages use to render.mdxfiles.
f8e9458 Thanks @Princesseuh! - Adds an @astrojs/internal-helpers/mdx entrypoint with the shared helpers the Markdown processor packages use to render .mdx files.8c193f6 Thanks @astrobot-houston! - Fixes incremental build cache invalidation caused by Shiki mutating the langAlias config object when loading languagesc895b12 Thanks @nicksnyder! - Updates dependency js-yaml to v4.3.0#17252 eb6f97e Thanks @matthewp! - Fixes trailing-slash handling for request paths that begin with a backslash
With trailingSlash: 'always', the standalone Node server could append a trailing slash to a request path that begins with a backslash (for example /\example.com/foo) and echo that path back in the Location header of a 301 response. Because browsers resolve a leading \ the same way as /, the resulting Location could point off-site.
Such paths are now recognized as internal paths, matching the existing handling for paths that begin with //, so they are no longer rewritten with a trailing slash.
f732f3c Thanks @Princesseuh! - Adds markdown, frontmatter, and shiki helper modules, shared by Astroβs content pipeline.c2cd371 Thanks @Princesseuh! - Fixes glob matching of remote patterns matching more paths than intended in select situations#15778 4ebc1e3 Thanks @ematipico! - Added a new entry point called /request, which exposes utilities to work with the Request type:
getFirstForwardedValue: retrieves the first value of a multi-value header.isValidIpAddress: checks whether a string contains only characters valid in IPv4/IPv6 addresses.getValidatedIpFromHeader: extracts the first value from a header and validates it as an IP address.getClientIpAddress: retrieves and validates the first IP from the x-forwarded-for header.#15077 a164c77 Thanks @matthewp! - Adds normalizePathname() utility function for normalizing URL pathnames to match the canonical form used by route generation.
#15419 a18d727 Thanks @ematipico! - Adds a new /cli specifier and the utility NPM_PACKAGE_NAME_REGEX.
#15369 240c317 Thanks @florian-lefebvre! - BREAKING CHANGE
Removes collapseDuplicateSlashes(), startsWithForwardSlash(), startsWithDotDotSlash(), startsWithDotSlash() and isAbsolutePath() from the /path export
#15771 745e632 Thanks @rururux! - Adds the new utilities MANY_LEADING_SLASHES and collapseDuplicateLeadingSlashes.
4ebc1e3 Thanks @ematipico! - Added a new entry point called /request, which exposes utilities to work with the Request type:
getFirstForwardedValue: retrieves the first value of a multi-value header.isValidIpAddress: checks whether a string contains only characters valid in IPv4/IPv6 addresses.getValidatedIpFromHeader: extracts the first value from a header and validates it as an IP address.getClientIpAddress: retrieves and validates the first IP from the x-forwarded-for header.#15369 240c317 Thanks @florian-lefebvre! - BREAKING CHANGE
Removes collapseDuplicateSlashes(), startsWithForwardSlash(), startsWithDotDotSlash(), startsWithDotSlash() and isAbsolutePath() from the /path export
#14791 9e9c528 Thanks @Princesseuh! - Changes the remote protocol checks for images to require explicit authorization in order to use data URIs.
In order to allow data URIs for remote images, you will need to update your astro.config.mjs file to include the following configuration:
import { defineConfig } from 'astro/config';
export default defineConfig({ images: { remotePatterns: [ { protocol: 'data', }, ], },});#14787 0f75f6b Thanks @matthewp! - Fixes wildcard hostname pattern matching to correctly reject hostnames without dots
Previously, hostnames like localhost or other single-part names would incorrectly match patterns like *.example.com. The wildcard matching logic has been corrected to ensure that only valid subdomains matching the pattern are accepted.
4d16de7 Thanks @ematipico! - Improves the detection of remote paths in the _image endpoint. Now href parameters that start with // are considered remote paths.