Skip to content

Commit

Permalink
Merge pull request #3482 from OSC/r_3.1.4
Browse files Browse the repository at this point in the history
update regular expression (#3476)
  • Loading branch information
HazelGrant committed Apr 1, 2024
2 parents bf3d784 + 36926ed commit bb965b6
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 bb965b6

Please sign in to comment.