From d0a4d4a996f604e2a4f7db7d98a9a3c7299fb2aa Mon Sep 17 00:00:00 2001 From: David SAUVAGE - AdaLabs Ltd Date: Sat, 13 Apr 2024 12:07:50 +0400 Subject: [PATCH] #376, Multipart_Message.Store_Attachments allows files to be uploaded on the server even is Upload_Directory is disabled (empty String) --- src/core/aws-server-http_utils.adb | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/core/aws-server-http_utils.adb b/src/core/aws-server-http_utils.adb index cf1995541..4fc94d96f 100644 --- a/src/core/aws-server-http_utils.adb +++ b/src/core/aws-server-http_utils.adb @@ -857,6 +857,11 @@ package body AWS.Server.HTTP_Utils is begin begin if Mode in Attachment .. File_Upload then + if CNF.Upload_Directory (Server_Config) = "" then + raise Constraint_Error + with "File upload not supported by server " + & CNF.Server_Name (Server_Config); + end if; Streams.Stream_IO.Create (File, Streams.Stream_IO.Out_File, Server_Filename); end if;