Skip to content

Commit 2a8defb

Browse files
committed
Merge bracket fix for testing
2 parents 83a067a + fee309a commit 2a8defb

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

script/redirects.js

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -121,6 +121,19 @@ function buildRedirects() {
121121
<action type="Redirect" url="https://{C:2}/{R:1}" redirectType="Permanent" />
122122
</rule>
123123
<!--END SSL-->
124+
<!--BEGIN Bracket-in-URL proxy - must come before trailing slash rule -->
125+
<rule name="Next.js static assets bracket-in-URL proxy" stopProcessing="true">
126+
<match url="^_next/static/(.*)\\[(.*)\\](.*)$" ignoreCase="true" />
127+
<conditions>
128+
<add input="{HTTP_HOST}" pattern="^(?:www.)?(.*)$" />
129+
</conditions>
130+
<action type="Rewrite" url="https://primer-docs-preview.github.com{UNENCODED_URL}" appendQueryString="false" />
131+
<serverVariables>
132+
<set name="HTTP_X_UNPROXIED_URL" value="https://primer-docs-preview.github.com{UNENCODED_URL}" />
133+
<set name="HTTP_X_ORIGINAL_HOST" value="{HTTP_HOST}" />
134+
</serverVariables>
135+
</rule>
136+
<!--END Bracket-in-URL proxy -->
124137
<!--BEGIN Trailing slash enforcement-->
125138
<rule name="Add trailing slash" stopProcessing="true">
126139
<match url="(.*[^/])$" />

0 commit comments

Comments
 (0)