1
0
mirror of https://github.com/sasjs/server.git synced 2025-12-10 11:24:35 +00:00

chore(web): quick fixes

This commit is contained in:
2022-07-27 00:47:38 +05:00
parent 7cdffe30e3
commit 468d1a929d
2 changed files with 12 additions and 2 deletions

View File

@@ -22,8 +22,14 @@ const FilePathInputModal = ({
const handleChange = (event: React.ChangeEvent<HTMLInputElement>) => {
const value = event.target.value
const regex = /\.(exe|sh|htaccess)$/i
if (regex.test(value)) {
const specialChars = /[`!@#$%^&*()_+\-=[\]{};':"\\|,<>?~]/
const fileExtension = /\.(exe|sh|htaccess)$/i
if (specialChars.test(value)) {
setHasError(true)
setErrorText('can not have special characters')
} else if (fileExtension.test(value)) {
setHasError(true)
setErrorText('can not save file with extensions [exe, sh, htaccess]')
} else {

View File

@@ -223,6 +223,10 @@ const SASjsEditor = ({
const saveFile = (filePath?: string) => {
setIsLoading(true)
if (filePath) {
filePath = filePath.startsWith('/') ? filePath : `/${filePath}`
}
const formData = new FormData()
const stringBlob = new Blob([fileContent], { type: 'text/plain' })