mirror of
https://github.com/Redocly/redoc.git
synced 2025-08-07 13:44:54 +03:00
correct path matching
This commit is contained in:
parent
df6b922330
commit
c1d5ab3468
|
@ -204,7 +204,7 @@ async function serve(port: number, pathToSpec: string, options: Options = {}) {
|
|||
} else {
|
||||
const filePath = normalize(join(dirname(pathToSpec), request.url || ''));
|
||||
const relativePath = relative(dirname(pathToSpec), filePath);
|
||||
if (options.static && options.static !== '' && relativePath.startsWith(options.static)) {
|
||||
if (options.static && options.static !== '' && relativePath.startsWith(options.static + '/')) {
|
||||
const file = createReadStream(filePath);
|
||||
file.on('open', function () {
|
||||
response.setHeader('Content-Type', lookup(filePath) || 'text/plain');
|
||||
|
|
Loading…
Reference in New Issue
Block a user