Skip to content

Commit 3b96701

Browse files
committed
More extensions
1 parent 5138f07 commit 3b96701

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

app/lib/frontend/handlers/documentation.dart

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -143,6 +143,13 @@ DocFilePath? parseRequestUri(Uri uri) {
143143
return DocFilePath(package, version, path);
144144
}
145145

146+
const _nonExpandedExtensions = {
147+
'.html',
148+
'.json',
149+
'.gz',
150+
'.png',
151+
'.svg',
152+
};
146153
// NOTE: This is a best-effort detection on the segments.
147154
// Instead, we should rather check if the file (or the updated path)
148155
// is in the generated output, and base the decision on the file list.
@@ -159,7 +166,7 @@ bool _expandToIndexHtml(List<String> segments) {
159166
return false;
160167
}
161168
final ext = p.extension(segments.last);
162-
return ext != '.html';
169+
return !_nonExpandedExtensions.contains(ext);
163170
}
164171

165172
bool _isValidVersion(String version) {

0 commit comments

Comments
 (0)