From 982611299e66933b9f4dd1c93002b87cef0707f4 Mon Sep 17 00:00:00 2001
From: ulrich
Date: Mon, 11 Nov 2024 13:08:34 +0000
Subject: [PATCH] Pruefung auf HTTP-Methode in Handler aufgenommen

---
 src/de/uhilger/neon/FileServer.java |    9 +++++++--
 1 files changed, 7 insertions(+), 2 deletions(-)

diff --git a/src/de/uhilger/neon/FileServer.java b/src/de/uhilger/neon/FileServer.java
index b768961..86aef24 100644
--- a/src/de/uhilger/neon/FileServer.java
+++ b/src/de/uhilger/neon/FileServer.java
@@ -53,14 +53,19 @@
   public static final String STR_COMMA = ",";
   public static final String STR_DOT = ".";
   public static final String STR_EMPTY = "";
+  public static final String STR_EQUAL = "=";
   
   public void serveFile(HttpExchange exchange) throws IOException {
     String fName = exchange.getRequestURI().getPath();
     try {
       fName = new HttpHelper().getFileName(exchange);
-      File fileToDeliver = new File((String) exchange
+      String fBase = (String) exchange
               .getHttpContext().getAttributes()
-              .getOrDefault(ATTR_FILE_BASE, STR_EMPTY), fName);
+              .getOrDefault(ATTR_FILE_BASE, STR_EMPTY);
+      //File fileToDeliver = new File((String) exchange
+         //     .getHttpContext().getAttributes()
+           //   .getOrDefault(ATTR_FILE_BASE, STR_EMPTY), fName);
+      File fileToDeliver = new File(fBase, fName);
       Headers headers = exchange.getRequestHeaders();
       if (headers.containsKey(RANGE_HEADER)) {
         new PartialFileServer().serveFileParts(exchange, fileToDeliver);

--
Gitblit v1.9.3