Indy fails to provide http headers for artifacts in remote repo via HEAD req
ruhan1 opened this issue · 2 comments
Below code in ContentAccessHandler.doHead return null
HttpExchangeMetadata httpMetadata = contentController.getHttpMetadata( sk, path );
Because it try to find the "target transfer" and then find its sibling http-metadata.json. However, for remote repo artifacts, the target transfer is null (even though matedata.json is there, downloaded by DefaultDownloadManager), and it ignores the sibling .json and returns null.
We may need to add a method getArbitraryHttpMetadata( sk, path ) by loading just http-metadata.json directly.
This can be reproduced by simply start up a standalone Indy, and do:
$ curl -I http://localhost:8080/api/group/public/org/dashbuilder/dashbuilder-all/0.4.0.Final/dashbuilder-all-0.4.0.Final.jar
I come up a quick fix by falling back to GET req for such case. But we need a better solution.
I think ContentController has something like this, called getHttpMetadata, that takes an arbitrary path... But I may be wrong
This is fixed.