Skip to content
Snippets Groups Projects
Verified Commit b5e17010 authored by Timm Fitschen's avatar Timm Fitschen
Browse files

BUG: fix forwarded headers in FileSystemResource

parent 60c79ab7
No related branches found
No related tags found
1 merge request!75Draft: ENH: file system: core
Pipeline #47491 failed
......@@ -100,14 +100,14 @@ public class FileSystemResource extends AbstractCaosDBServerResource {
}
if (file.getObjectType() == ObjectType.DIRECTORY) {
String referenceString = getReference().toString();
if (!referenceString.endsWith(Path.DEFAULT_PATH_SEPARATOR)) {
referenceString = referenceString + Path.DEFAULT_PATH_SEPARATOR;
String url = getUtils().getServerRootURI() + "/FileSystem/" + path.toString();
if (!url.endsWith(Path.DEFAULT_PATH_SEPARATOR)) {
url = url + Path.DEFAULT_PATH_SEPARATOR;
}
final Element folder = new Element("dir");
folder.setAttribute("path", Path.DEFAULT_PATH_SEPARATOR + file.getPath().toString());
folder.setAttribute("name", path.isEmpty() ? "/" : file.getName());
folder.setAttribute("url", referenceString);
folder.setAttribute("url", url);
for (final VirtualFSODescriptorInterface child : file.listChildren()) {
Element celem = null;
......@@ -115,8 +115,7 @@ public class FileSystemResource extends AbstractCaosDBServerResource {
case DIRECTORY:
celem = new Element("dir");
celem.setAttribute("name", child.getName());
celem.setAttribute(
"url", referenceString + child.getName() + Path.DEFAULT_PATH_SEPARATOR);
celem.setAttribute("url", url + child.getName() + Path.DEFAULT_PATH_SEPARATOR);
break;
case LINK:
// TODO
......@@ -125,7 +124,7 @@ public class FileSystemResource extends AbstractCaosDBServerResource {
case FILE:
celem = new Element("file");
celem.setAttribute("name", child.getName());
celem.setAttribute("url", referenceString + child.getName());
celem.setAttribute("url", url + child.getName());
break;
default:
throw new UnsupportedOperationException(
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment