Skip to content

Commit

Permalink
feat(serve): support request carries .(DOT) character fix #2415, fix #…
Browse files Browse the repository at this point in the history
  • Loading branch information
anncwb committed Mar 22, 2021
1 parent 23f57ee commit 827b10b
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 0 deletions.
9 changes: 9 additions & 0 deletions docs/config/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -403,6 +403,15 @@ export default ({ command, mode }) => {

File system watcher options to pass on to [chokidar](https://github.com/paulmillr/chokidar#api).

### server.disableDotRule

- **Type:** `boolean`
- **Default:** `false`

Allow .(DOT) character in the request path.

Set to `true` to allow requests to carry .(DOT) character.

## Build Options

### build.target
Expand Down
9 changes: 9 additions & 0 deletions packages/vite/src/node/server/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,14 @@ export interface ServerOptions {
* Should start and end with the `/` character
*/
base?: string

/**
* uses https://github.com/bripkens/connect-history-api-fallback#disabledotrule
* Note: Allow .(DOT) character in the request path.
* Set to `true` to allow requests to carry .(DOT) character
* default: false
*/
disableDotRule?: boolean
}

/**
Expand Down Expand Up @@ -436,6 +444,7 @@ export async function createServer(
if (!middlewareMode) {
middlewares.use(
history({
disableDotRule: !!serverConfig.disableDotRule,
logger: createDebugger('vite:spa-fallback'),
// support /dir/ without explicit index.html
rewrites: [
Expand Down

0 comments on commit 827b10b

Please sign in to comment.