diff --git a/gitlab/functions.sh b/gitlab/functions.sh
index a05dff2516c342ca6c425a6bf7284e9726c17c5d..5556c3173857b94923a425f72a4cc9993a8d4ed6 100644
--- a/gitlab/functions.sh
+++ b/gitlab/functions.sh
@@ -207,20 +207,20 @@ dav_delete() {
   log_info "curl: EXISTS ${1}?"
 
   # checks if the directory exists before trying to remove it (use --head)
-  local code=$(curl --location --silent --fail --write-out "%{http_code}" --head --user "${DOCUSER}:${DOCPASS}" "$1")
+  local code=$(curl --location --silent --fail --write-out "%{http_code}" --head --user "${DOCUSER}:${DOCPASS}" "${DOCSERVER}/$1")
   if [[ ${code} == *404 ]]; then
     log_info "Directory $1 does not exist. Skipping deletion"
     return 0
   fi
 
   log_info "curl: DELETE ${1}..."
-  code=$(curl --location --silent --fail --write-out "%{http_code}" --user "${DOCUSER}:${DOCPASS}" -X DELETE "$1")
+  code=$(curl --location --silent --fail --write-out "%{http_code}" --user "${DOCUSER}:${DOCPASS}" -X DELETE "${DOCSERVER}/$1")
 
   if [[ ${code} == *204 || ${code} == *201 ]]; then
     log_info "Successfully deleted ${1} with curl"
   else
     log_error "Curl command finished with an error condition (code=${code}):"
-    curl --location --silent --user "${DOCUSER}:${DOCPASS}" -X DELETE "$1"
+    curl --location --silent --user "${DOCUSER}:${DOCPASS}" -X DELETE "${DOCSERVER}/$1"
     exit "${code}"
   fi
 }