4000: URI Resolver - must support HEAD request
Task-Url: https://support.d4science.org/issues/4000 Added MultiReadHttpServletRequest in order to serve doHead correctly git-svn-id: http://svn.research-infrastructures.eu/public/d4science/gcube/trunk/data-transfer/uri-resolver@128628 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
parent
1e4a4e1083
commit
4c21b784f9
|
@ -3,6 +3,8 @@ package org.gcube.datatransfer.resolver.http;
|
|||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.io.OutputStream;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
import javax.servlet.ServletConfig;
|
||||
import javax.servlet.ServletException;
|
||||
|
@ -16,6 +18,7 @@ import org.gcube.contentmanagement.blobstorage.service.IClient;
|
|||
import org.gcube.contentmanager.storageclient.model.protocol.smp.Handler;
|
||||
import org.gcube.contentmanager.storageclient.wrapper.AccessType;
|
||||
import org.gcube.contentmanager.storageclient.wrapper.StorageClient;
|
||||
import org.gcube.datatransfer.resolver.MultiReadHttpServletRequest;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
|
@ -205,8 +208,13 @@ public class StorageIDResolver extends HttpServlet {
|
|||
protected void doHead(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
|
||||
logger.info("doHead working..");
|
||||
|
||||
req.setAttribute(VALIDATION, "true");
|
||||
doGet(req, resp);
|
||||
//ADDING PARAMETER TO PERFORM ONLY VALIDATION
|
||||
Map<String, String[]> additionalParams = new HashMap<String, String[]>();
|
||||
String[] value = new String[1];
|
||||
value[0] = "true";
|
||||
additionalParams.put(VALIDATION, value);
|
||||
MultiReadHttpServletRequest request = new MultiReadHttpServletRequest(req, additionalParams);
|
||||
doGet(request, resp);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Reference in New Issue