Commit ff6a3bbe authored by Nicola Fulvio Calabria's avatar Nicola Fulvio Calabria
Browse files

Removed job_id from external link generated endpoint

parent 526288d2
Loading
Loading
Loading
Loading
+10 −11
Original line number Diff line number Diff line
@@ -224,6 +224,10 @@ public class UriService {

        if (isLinkNode) {
            endpoint = ((LinkNode) node).getTarget();
            String linkTarget = ((LinkNode) node).getTarget();
            if (linkedServiceDAO.isLinkedServiceUrl(linkTarget)) {
                endpoint += "&token=" + getEndpointToken(linkTarget);
            }
        } else {

            Location location = locationDAO.getNodeLocation(relativePath).orElse(null);
@@ -238,18 +242,13 @@ public class UriService {
            } else {
                endpoint = fileServiceUrl + urlEncodePath(relativePath);
            }
        }

            endpoint += "?jobId=" + job.getJobId();

        if (isLinkNode) {
            String linkTarget = ((LinkNode) node).getTarget();
            if (linkedServiceDAO.isLinkedServiceUrl(linkTarget)) {
                endpoint += "&token=" + getEndpointToken(linkTarget);
            }
        } else if (!"true".equals(NodeProperties.getNodePropertyByURI(node, NodeProperties.PUBLIC_READ_URI))) {
            if (!"true".equals(NodeProperties.getNodePropertyByURI(node, NodeProperties.PUBLIC_READ_URI))) {
                endpoint += "&token=" + getEndpointToken(fileServiceUrl + relativePath);
            }
        }

        return endpoint;
    }