Skip to content

Commit a909c82

Browse files
committed
fix: allow CORS from loopback addresses by default (vitejs#598) (vitejs#996)
Co-authored-by: Rush Ali <[email protected]> closes vitejs#598 vitejs#996
1 parent af59b91 commit a909c82

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

docs/config/server-options.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,7 @@ export default defineConfig({
160160
## server.cors
161161

162162
- **Typ:** `boolean | CorsOptions`
163-
- **Standardwert:** `false`
163+
- **Standardwert:** `{ origin: /^https?:\/\/(?:(?:[^:]+\.)?localhost|127\.0\.0\.1|\[::1\])(?::\d+)?$/ }` (erlaubt localhost, `127.0.0.1` und `::1`)
164164

165165
Konfigurieren Sie CORS für den Entwicklungsserver. Übergeben Sie ein [Optionsobjekt](https://github.com/expressjs/cors#configuration-options), um das Verhalten fein abzustimmen, oder `false`, um es zu deaktivieren.
166166

0 commit comments

Comments
 (0)