File tree Expand file tree Collapse file tree 1 file changed +3
-3
lines changed
Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -137,12 +137,12 @@ async function resolvePluginOrSchemaUrl(url: URL) {
137137
138138function getAccessControlAllowOrigin ( request : Request ) {
139139 const origin = request . headers . get ( "origin" ) ;
140- return origin != null && isAllowedLocalHostname ( new URL ( origin ) . hostname )
140+ return origin != null && isLocalHostname ( new URL ( origin ) . hostname )
141141 ? origin
142142 : "https://dprint.dev" ;
143143}
144144
145- function isAllowedLocalHostname ( hostname : string ) {
145+ function isLocalHostname ( hostname : string ) {
146146 return hostname === "localhost" || hostname === "127.0.0.1" ;
147147}
148148
@@ -158,7 +158,7 @@ function shouldDirectlyServeFile(request: Request) {
158158 }
159159
160160 const hostname = new URL ( origin ) . hostname ;
161- return hostname === "localhost" || hostname === "dprint.dev" ;
161+ return isLocalHostname ( hostname ) || hostname === "dprint.dev" ;
162162}
163163
164164function createRedirectResponse ( location : string ) {
You can’t perform that action at this time.
0 commit comments