We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent e97fe73 commit bf73f50Copy full SHA for bf73f50
src/components/InnerLinkPreview.astro
@@ -225,7 +225,12 @@
225
// Construct a full URL from a relative path, ensuring it uses the page's origin.
226
const url = new URL(rawHref, window.location.origin);
227
// Force HTTPS protocol to prevent mixed content issues in production.
228
- url.protocol = 'https:';
+ url.protocol = 'https';
229
+
230
+ // Ensure trailing slash to prevent server-side redirects to http.
231
+ if (!url.pathname.endsWith('/') && !url.pathname.split('/').pop()?.includes('.')) {
232
+ url.pathname += '/';
233
+ }
234
235
return url.href;
236
}
0 commit comments