weekwood / editorjs-video

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

431 (Request Header Fields Too Large)

kakharmanov opened this issue · comments

Hi there! Firstly i want to give very big respect to author for this opportunity to use this plugin!

My question is why i get an error while i use custom uploader, after I send the request to the server I get this error message 431, because plugin generates a link where link have base64 code, this causes error 431. How fix it?

Снимок экрана 2024-01-17 в 13 55 05
uploader: {
          uploadByFile: async (file:any) => {
            let item
            const formData = new FormData()

            props.selectedPageId ? formData.append('model_id', props.selectedPageId) : formData.append('uuid', props.hash)

            formData.append('model_type', 'pages');
            formData.append('file', file);

            await axios.post('/support/files', formData, {
              headers: {
                'Authorization': 'Bearer '+ localStorage.token,
                'Content-Type': 'multipart/form-data'
              },
              withCredentials: true
            })
            .then((response: any) => {
              item = {
                success: 1,
                file: {
                  id: response.data.data.id,
                  url: response.data.url,
                }
              }
              notificationStore.addNotification({ type: 'success', text: 'Видеофайл успешно загружен!', duration: 3000 })
            }).catch(err => {
              notificationStore.addNotification({ type: 'error', text: 'Что-то пошло не так, ошибка загрузки видеофайла!', duration: 3000 })
            })
          return item
        }},