fix: .cc/.hh后缀文件无法进行纳入审计的问题.
This commit is contained in:
parent
9fa3a18a4b
commit
a54b8da672
|
|
@ -5,7 +5,7 @@ import { taskControl } from "@/shared/services/taskControl";
|
|||
type GithubTreeItem = { path: string; type: "blob" | "tree"; size?: number; url: string; sha: string };
|
||||
|
||||
const TEXT_EXTENSIONS = [
|
||||
".js", ".ts", ".tsx", ".jsx", ".py", ".java", ".go", ".rs", ".cpp", ".c", ".h", ".cs", ".php", ".rb", ".kt", ".swift", ".sql", ".sh", ".json", ".yml", ".yaml"
|
||||
".js", ".ts", ".tsx", ".jsx", ".py", ".java", ".go", ".rs", ".cpp", ".c", ".h", ".cc", ".hh", ".cs", ".php", ".rb", ".kt", ".swift", ".sql", ".sh", ".json", ".yml", ".yaml"
|
||||
// 注意:已移除 .md,因为文档文件会导致LLM返回非JSON格式
|
||||
];
|
||||
const MAX_FILE_SIZE_BYTES = 200 * 1024;
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@ import { api } from "@/shared/config/database";
|
|||
import { taskControl } from "@/shared/services/taskControl";
|
||||
|
||||
const TEXT_EXTENSIONS = [
|
||||
".js", ".ts", ".tsx", ".jsx", ".py", ".java", ".go", ".rs", ".cpp", ".c", ".h",
|
||||
".js", ".ts", ".tsx", ".jsx", ".py", ".java", ".go", ".rs", ".cpp", ".c", ".h", ".cc", ".hh",
|
||||
".cs", ".php", ".rb", ".kt", ".swift", ".sql", ".sh", ".json", ".yml", ".yaml"
|
||||
// 注意:已移除 .md,因为文档文件会导致LLM返回非JSON格式
|
||||
];
|
||||
|
|
@ -99,6 +99,9 @@ function getLanguageFromPath(path: string): string {
|
|||
'rs': 'rust',
|
||||
'cpp': 'cpp',
|
||||
'c': 'cpp',
|
||||
'cc': 'cpp',
|
||||
'h': 'cpp',
|
||||
'hh': 'cpp',
|
||||
'cs': 'csharp',
|
||||
'php': 'php',
|
||||
'rb': 'ruby',
|
||||
|
|
|
|||
|
|
@ -226,6 +226,9 @@ public class Example {
|
|||
'rs': 'rust',
|
||||
'cpp': 'cpp',
|
||||
'c': 'cpp',
|
||||
'cc': 'cpp',
|
||||
'h': 'cpp',
|
||||
'hh': 'cpp',
|
||||
'cs': 'csharp',
|
||||
'php': 'php',
|
||||
'rb': 'ruby'
|
||||
|
|
@ -523,7 +526,7 @@ public class Example {
|
|||
<input
|
||||
ref={fileInputRef}
|
||||
type="file"
|
||||
accept=".js,.jsx,.ts,.tsx,.py,.java,.go,.rs,.cpp,.c,.cs,.php,.rb"
|
||||
accept=".js,.jsx,.ts,.tsx,.py,.java,.go,.rs,.cpp,.c,.cc,.h,.hh,.cs,.php,.rb"
|
||||
onChange={handleFileUpload}
|
||||
className="hidden"
|
||||
/>
|
||||
|
|
|
|||
|
|
@ -91,6 +91,9 @@ export function getLanguageFromExtension(extension: string): string {
|
|||
'rs': 'rust',
|
||||
'cpp': 'cpp',
|
||||
'c': 'cpp',
|
||||
'cc': 'cpp',
|
||||
'h': 'cpp',
|
||||
'hh': 'cpp',
|
||||
'cs': 'csharp',
|
||||
'php': 'php',
|
||||
'rb': 'ruby',
|
||||
|
|
|
|||
Loading…
Reference in New Issue