( configOrUrl: ResolvedConfig | string, urlOrServer: string | ViteDevServer, )
| 255 | server: ViteDevServer, |
| 256 | ): boolean |
| 257 | export function isFileServingAllowed( |
| 258 | configOrUrl: ResolvedConfig | string, |
| 259 | urlOrServer: string | ViteDevServer, |
| 260 | ): boolean { |
| 261 | const config = ( |
| 262 | typeof urlOrServer === 'string' ? configOrUrl : urlOrServer.config |
| 263 | ) as ResolvedConfig |
| 264 | const url = ( |
| 265 | typeof urlOrServer === 'string' ? urlOrServer : configOrUrl |
| 266 | ) as string |
| 267 | |
| 268 | if (!config.server.fs.strict) return true |
| 269 | const filePath = fsPathFromUrl(url) |
| 270 | return isFileLoadingAllowed(config, filePath) |
| 271 | } |
| 272 | |
| 273 | /** |
| 274 | * Warning: parameters are not validated, only works with normalized absolute paths |
nothing calls this directly
no test coverage detected