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:
@@ -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 {
|
||||
|
||||
@@ -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' })
|
||||
|
||||
Reference in New Issue
Block a user