Skip to content

Commit cc2837b

Browse files
fix(web): Fix error when loading files with special characters (#637)
1 parent 0633d1f commit cc2837b

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1212

1313
### Fixed
1414
- Fixed issue where single quotes could not be used in search queries. [#629](https://github.com/sourcebot-dev/sourcebot/pull/629)
15+
- Fixed issue where files with special characters would fail to load. [#636](https://github.com/sourcebot-dev/sourcebot/issues/636)
1516

1617
## [4.10.0] - 2025-11-24
1718

packages/web/src/features/search/fileSourceApi.ts

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import { search } from "./searchApi";
66
import { sew } from "@/actions";
77
import { withOptionalAuthV2 } from "@/withAuthV2";
88
import { QueryIR } from './ir';
9+
910
// @todo (bkellam) #574 : We should really be using `git show <hash>:<path>` to fetch file contents here.
1011
// This will allow us to support permalinks to files at a specific revision that may not be indexed
1112
// by zoekt. We should also refactor this out of the /search folder.
@@ -21,12 +22,12 @@ export const getFileSource = async ({ fileName, repository, branch }: FileSource
2122
},
2223
},
2324
{
24-
regexp: {
25-
regexp: fileName,
25+
substring: {
26+
pattern: fileName,
2627
case_sensitive: true,
2728
file_name: true,
28-
content: false
29-
},
29+
content: false,
30+
}
3031
},
3132
...(branch ? [{
3233
branch: {

0 commit comments

Comments
 (0)