1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48
|
Description: Add exceptions back that have been removed upstream.
Author: Andreas B. Mundt <andi@debian.org>
Forwarded: not-needed
Last-Update: 2023-10-29
---
This patch header follows DEP-3: http://dep.debian.net/deps/dep3/
--- a/src/main/java/filius/rahmenprogramm/ResourceUtil.java
+++ b/src/main/java/filius/rahmenprogramm/ResourceUtil.java
@@ -22,9 +22,13 @@
String urlEncodedPath = getResourceUrlEncodedPath(relativePath);
String path = null;
if (urlEncodedPath != null) {
- LOG.debug(urlEncodedPath);
- path = UriUtils.decode(urlEncodedPath, "utf8");
- LOG.debug("Resolved path: " + path);
+ try {
+ LOG.debug(urlEncodedPath);
+ path = UriUtils.decode(urlEncodedPath, "utf8");
+ LOG.debug("Resolved path: " + path);
+ } catch (Exception e) {
+ LOG.debug("Resource " + relativePath + " could not be resolved (" + urlEncodedPath + ")");
+ }
}
return path;
}
--- a/src/main/java/filius/software/www/HTTPNachricht.java
+++ b/src/main/java/filius/software/www/HTTPNachricht.java
@@ -413,12 +413,18 @@
}
protected static String encodePath(String path) {
- String urlEncodedPath = UriUtils.encodePath(path, "utf8");
+ String urlEncodedPath = "";
+ try {
+ urlEncodedPath = UriUtils.encodePath(path, "utf8");
+ } catch (Exception e) {}
return urlEncodedPath;
}
protected static String decodePath(String urlEncodedPath) {
- String path = UriUtils.decode(urlEncodedPath, "utf8");
+ String path = "";
+ try {
+ path = UriUtils.decode(urlEncodedPath, "utf8");
+ } catch (Exception e) {}
return path;
}
}
|