fix // in file url
This commit is contained in:
@@ -16,7 +16,7 @@ export { format_time, Time, TitleLine };
|
|||||||
|
|
||||||
export const API_BASE = `${process.env.REACT_APP_BACKEND || '/'}_api/v1`;
|
export const API_BASE = `${process.env.REACT_APP_BACKEND || '/'}_api/v1`;
|
||||||
export const API_BASE_2 = `${process.env.REACT_APP_BACKEND || '/'}_api/v2`;
|
export const API_BASE_2 = `${process.env.REACT_APP_BACKEND || '/'}_api/v2`;
|
||||||
export const STORAGE_BASE = `${process.env.REACT_APP_STORAGE || ''}`;
|
export const STORAGE_BASE = `${process.env.REACT_APP_STORAGE || '/'}`;
|
||||||
|
|
||||||
// https://stackoverflow.com/questions/3446170/escape-string-for-use-in-javascript-regex
|
// https://stackoverflow.com/questions/3446170/escape-string-for-use-in-javascript-regex
|
||||||
function escape_regex(string) {
|
function escape_regex(string) {
|
||||||
|
|||||||
@@ -679,7 +679,7 @@ export class PostForm extends Component {
|
|||||||
|
|
||||||
update_text_after_upload(data) {
|
update_text_after_upload(data) {
|
||||||
const { file_name, file_type } = this.state;
|
const { file_name, file_type } = this.state;
|
||||||
let url = `${STORAGE_BASE}/${data.path}?filename=${encodeURIComponent(
|
let url = `${STORAGE_BASE}${data.path}?filename=${encodeURIComponent(
|
||||||
file_name,
|
file_name,
|
||||||
)}&filetype=${encodeURIComponent(file_type)}`;
|
)}&filetype=${encodeURIComponent(file_type)}`;
|
||||||
let new_text =
|
let new_text =
|
||||||
|
|||||||
Reference in New Issue
Block a user