Skip to content

Commit c6432b1

Browse files
iandevsim51
authored andcommitted
[gephi-lite] Fix extractGraphFromFile
When opening a reomte file, some will have query params, such as a pre-signed url to a cloud hosted storage bucket. Ex: https://www.example.com/graph.gexf?token=XXX But url like https://www.example.com/index.php?file=graph.gexf are also valid, as well as https://www.example.com/xzy (which can be a shared link with a valid file). So computing the file format from the filename is not a the good way to do it, we need to parse the file content and check what it is.
1 parent 8d1f50c commit c6432b1

File tree

9 files changed

+7404
-25
lines changed

9 files changed

+7404
-25
lines changed
Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
export const Errors = {
22
IMPORT_BAD_VERSION: (args: { version: string }) =>
33
`Your file is from an older version of gephi-lite (${args.version}) which is not compatible with the actual version`,
4-
IMPORT_BAD_FORMAT: (args: { extension: string; fileName: string }) =>
5-
`Extension ${args.extension} for file ${args.fileName} is not recognized`,
4+
IMPORT_BAD_FILE_FORMAT: (args: { fileName: string }) => `Format of file ${args.fileName} is not recognized`,
65
};
76

87
export type ErrorCode = keyof typeof Errors;

0 commit comments

Comments
 (0)