Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
C
canifa_note
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Vũ Hoàng Anh
canifa_note
Commits
1f1add1a
Unverified
Commit
1f1add1a
authored
Aug 08, 2025
by
Sara Vieira
Committed by
GitHub
Aug 08, 2025
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: add mime type check for file types (#4981)
parent
15c146cf
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
13 additions
and
1 deletion
+13
-1
package.json
web/package.json
+1
-0
pnpm-lock.yaml
web/pnpm-lock.yaml
+10
-0
UploadAttachmentButton.tsx
...onents/MemoEditor/ActionButton/UploadAttachmentButton.tsx
+2
-1
No files found.
web/package.json
View file @
1f1add1a
...
@@ -40,6 +40,7 @@
...
@@ -40,6 +40,7 @@
"lodash-es"
:
"^4.17.21"
,
"lodash-es"
:
"^4.17.21"
,
"lucide-react"
:
"^0.486.0"
,
"lucide-react"
:
"^0.486.0"
,
"mermaid"
:
"^11.9.0"
,
"mermaid"
:
"^11.9.0"
,
"mime"
:
"^4.0.7"
,
"mobx"
:
"^6.13.7"
,
"mobx"
:
"^6.13.7"
,
"mobx-react-lite"
:
"^4.1.0"
,
"mobx-react-lite"
:
"^4.1.0"
,
"react"
:
"^18.3.1"
,
"react"
:
"^18.3.1"
,
...
...
web/pnpm-lock.yaml
View file @
1f1add1a
...
@@ -104,6 +104,9 @@ importers:
...
@@ -104,6 +104,9 @@ importers:
mermaid
:
mermaid
:
specifier
:
^11.9.0
specifier
:
^11.9.0
version
:
11.9.0
version
:
11.9.0
mime
:
specifier
:
^4.0.7
version
:
4.0.7
mobx
:
mobx
:
specifier
:
^6.13.7
specifier
:
^6.13.7
version
:
6.13.7
version
:
6.13.7
...
@@ -2723,6 +2726,11 @@ packages:
...
@@ -2723,6 +2726,11 @@ packages:
resolution
:
{
integrity
:
sha512-PXwfBhYu0hBCPw8Dn0E+WDYb7af3dSLVWKi3HGv84IdF4TyFoC0ysxFd0Goxw7nSv4T/PzEJQxsYsEiFCKo2BA==
}
resolution
:
{
integrity
:
sha512-PXwfBhYu0hBCPw8Dn0E+WDYb7af3dSLVWKi3HGv84IdF4TyFoC0ysxFd0Goxw7nSv4T/PzEJQxsYsEiFCKo2BA==
}
engines
:
{
node
:
'
>=8.6'
}
engines
:
{
node
:
'
>=8.6'
}
mime@4.0.7
:
resolution
:
{
integrity
:
sha512-2OfDPL+e03E0LrXaGYOtTFIYhiuzep94NSsuhrNULq+stylcJedcHdzHtz0atMUuGwJfFYs0YL5xeC/Ca2x0eQ==
}
engines
:
{
node
:
'
>=16'
}
hasBin
:
true
minimatch@3.1.2
:
minimatch@3.1.2
:
resolution
:
{
integrity
:
sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==
}
resolution
:
{
integrity
:
sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==
}
...
@@ -6210,6 +6218,8 @@ snapshots:
...
@@ -6210,6 +6218,8 @@ snapshots:
braces
:
3.0.3
braces
:
3.0.3
picomatch
:
2.3.1
picomatch
:
2.3.1
mime@4.0.7
:
{}
minimatch@3.1.2
:
minimatch@3.1.2
:
dependencies
:
dependencies
:
brace-expansion
:
1.1.12
brace-expansion
:
1.1.12
...
...
web/src/components/MemoEditor/ActionButton/UploadAttachmentButton.tsx
View file @
1f1add1a
import
{
t
}
from
"i18next"
;
import
{
t
}
from
"i18next"
;
import
{
LoaderIcon
,
PaperclipIcon
}
from
"lucide-react"
;
import
{
LoaderIcon
,
PaperclipIcon
}
from
"lucide-react"
;
import
mime
from
"mime"
;
import
{
observer
}
from
"mobx-react-lite"
;
import
{
observer
}
from
"mobx-react-lite"
;
import
{
useContext
,
useRef
,
useState
}
from
"react"
;
import
{
useContext
,
useRef
,
useState
}
from
"react"
;
import
toast
from
"react-hot-toast"
;
import
toast
from
"react-hot-toast"
;
...
@@ -51,7 +52,7 @@ const UploadAttachmentButton = observer((props: Props) => {
...
@@ -51,7 +52,7 @@ const UploadAttachmentButton = observer((props: Props) => {
attachment
:
Attachment
.
fromPartial
({
attachment
:
Attachment
.
fromPartial
({
filename
,
filename
,
size
,
size
,
type
,
type
:
type
||
mime
.
getType
(
filename
)
||
""
,
content
:
buffer
,
content
:
buffer
,
}),
}),
attachmentId
:
""
,
attachmentId
:
""
,
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment