From 36926ed31d99b7795559f69c1f46ef5d878ddfda Mon Sep 17 00:00:00 2001 From: matt <57604545+matt257@users.noreply.github.com> Date: Thu, 28 Mar 2024 14:10:54 -0400 Subject: [PATCH] update regular expression (#3476) --- apps/dashboard/app/models/posix_file.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/dashboard/app/models/posix_file.rb b/apps/dashboard/app/models/posix_file.rb index 6289a8d52b..effbf44921 100644 --- a/apps/dashboard/app/models/posix_file.rb +++ b/apps/dashboard/app/models/posix_file.rb @@ -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"