Skip to content

Commit

Permalink
update regular expression (#3476)
Browse files Browse the repository at this point in the history
  • Loading branch information
matt257 authored and HazelGrant committed Apr 1, 2024
1 parent bf3d784 commit 36926ed
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion apps/dashboard/app/models/posix_file.rb
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,7 @@ def mime_type
# > this is not be considered an error that affects the exit status.
#
# so instead we validate it against a regex that match mimetypes
raise "not valid mimetype: #{type}" unless type =~ /^\w+\/[-+\.\w]+$/
raise "not valid mimetype: #{type}" unless type =~ /\A\w+\/[-+\.\w]+\z/

# if you touch a file and it is empty, the mime type is "inode/x-empty"
# but in our interaction with the file we would treat this as "text/plain"
Expand Down

0 comments on commit 36926ed

Please sign in to comment.