From d650e557b0e0cd42c55048a8573a668f7f173d23 Mon Sep 17 00:00:00 2001 From: Sutu Sebastian Date: Sat, 24 Oct 2026 15:46:49 +0300 Subject: [PATCH 1/2] chore: CORS for agent-readability, negotiate index.html --- apps/docs/public/.htaccess | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/apps/docs/public/.htaccess b/apps/docs/public/.htaccess index 7d7c15c..b7753ac 100644 --- a/apps/docs/public/.htaccess +++ b/apps/docs/public/.htaccess @@ -71,7 +71,7 @@ ErrorDocument 404 /codemap/404.html - + Header set Access-Control-Allow-Origin "*" @@ -91,6 +91,11 @@ RewriteCond %{HTTP:Accept} text/markdown [NC] RewriteCond %{HTTP:Accept} !text/markdown\s*;\s*q\s*=\s*0(\.0*)?(\s*[;,]|\s*$) [NC] RewriteRule ^$ /codemap/index.md [L,T=text/markdown] +# /codemap/index.html -> /codemap/index.md (same representation as /codemap/) +RewriteCond %{HTTP:Accept} text/markdown [NC] +RewriteCond %{HTTP:Accept} !text/markdown\s*;\s*q\s*=\s*0(\.0*)?(\s*[;,]|\s*$) [NC] +RewriteRule ^index\.html$ /codemap/index.md [L,T=text/markdown] + # /codemap/ -> twin .md RewriteCond %{HTTP:Accept} text/markdown [NC] RewriteCond %{HTTP:Accept} !text/markdown\s*;\s*q\s*=\s*0(\.0*)?(\s*[;,]|\s*$) [NC] From 63f1783b5f39d40689bccc5d1085640afa7ce037 Mon Sep 17 00:00:00 2001 From: Sutu Sebastian Date: Sat, 24 Oct 2026 15:56:49 +0300 Subject: [PATCH 2/2] chore: honor q=0 after media params, expr Link for rewrites --- apps/docs/public/.htaccess | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/apps/docs/public/.htaccess b/apps/docs/public/.htaccess index b7753ac..8c0a040 100644 --- a/apps/docs/public/.htaccess +++ b/apps/docs/public/.htaccess @@ -62,7 +62,8 @@ ErrorDocument 404 /codemap/404.html SetEnvIf Request_URI "^/codemap/index\.html$" IS_CODEMAP_HOME - Header always set Link "; rel=\"api-catalog\"; type=\"application/linkset+json\", ; rel=\"ai-catalog\"; type=\"application/ai-catalog+json\", ; rel=\"service-desc\"; type=\"application/json\", ; rel=\"describedby\"; type=\"application/json\", ; rel=\"describedby\"; type=\"text/plain\", ; rel=\"alternate\"; type=\"text/markdown\"" env=IS_CODEMAP_HOME + # expr covers REDIRECT_ rename after internal rewrites (e.g. /codemap/index.html -> /codemap/index.md). + Header always set Link "; rel=\"api-catalog\"; type=\"application/linkset+json\", ; rel=\"ai-catalog\"; type=\"application/ai-catalog+json\", ; rel=\"service-desc\"; type=\"application/json\", ; rel=\"describedby\"; type=\"application/json\", ; rel=\"describedby\"; type=\"text/plain\", ; rel=\"alternate\"; type=\"text/markdown\"" "expr=%{ENV:IS_CODEMAP_HOME} || %{ENV:REDIRECT_IS_CODEMAP_HOME}" # Extensionless file needs explicit type (else text/plain fails the scan). @@ -88,17 +89,17 @@ RewriteRule ^ - [L] # /codemap/ -> /codemap/index.md RewriteCond %{HTTP:Accept} text/markdown [NC] -RewriteCond %{HTTP:Accept} !text/markdown\s*;\s*q\s*=\s*0(\.0*)?(\s*[;,]|\s*$) [NC] +RewriteCond %{HTTP:Accept} !text/markdown(?:\s*;\s*(?!q\s*=)[^;,]+)*\s*;\s*q\s*=\s*0(\.0*)?(\s*[;,]|\s*$) [NC] RewriteRule ^$ /codemap/index.md [L,T=text/markdown] # /codemap/index.html -> /codemap/index.md (same representation as /codemap/) RewriteCond %{HTTP:Accept} text/markdown [NC] -RewriteCond %{HTTP:Accept} !text/markdown\s*;\s*q\s*=\s*0(\.0*)?(\s*[;,]|\s*$) [NC] +RewriteCond %{HTTP:Accept} !text/markdown(?:\s*;\s*(?!q\s*=)[^;,]+)*\s*;\s*q\s*=\s*0(\.0*)?(\s*[;,]|\s*$) [NC] RewriteRule ^index\.html$ /codemap/index.md [L,T=text/markdown] # /codemap/ -> twin .md RewriteCond %{HTTP:Accept} text/markdown [NC] -RewriteCond %{HTTP:Accept} !text/markdown\s*;\s*q\s*=\s*0(\.0*)?(\s*[;,]|\s*$) [NC] +RewriteCond %{HTTP:Accept} !text/markdown(?:\s*;\s*(?!q\s*=)[^;,]+)*\s*;\s*q\s*=\s*0(\.0*)?(\s*[;,]|\s*$) [NC] RewriteCond %{REQUEST_FILENAME} !\.md$ [NC] RewriteCond %{DOCUMENT_ROOT}/codemap/$1.md -f RewriteRule ^(.+?)/?$ /codemap/$1.md [L,T=text/markdown]