htsjdk
htsjdk copied to clipboard
htsget requests are not following redirects?
Hi,
All IGV unit tests using the htsget reference server at htsget://htsget.ga4gh.org started failing inexplicably. I think at least one problem might be that the connections do not appear to be following redirects, see the stack trace below.
Unrecognized status code: 301
java.lang.IllegalStateException: Unrecognized status code: 301
at [email protected]/htsjdk.samtools.util.htsget.HtsgetRequest.getResponse(HtsgetRequest.java:286)
at [email protected]/htsjdk.samtools.HtsgetBAMFileReader.
Hi, sorry for the late response. I believe this is due to java's HTTPUrlConnection not following redirects across different protocols for security reasons. It should follow redirects automatically for HTTP -> HTTP or HTTPS -> HTTPS, but I suspect the redirect causing the failure might be from HTTPS -> HTTP or the other way around.
@lbergelson do you think putting in the code to manually follow redirects across protocols, or maybe adding an option to do so would be a good idea?
@andersleung @lbergelson I think there are other problems with the reference server, or rather were at the time this was filed. If its the case that the reference is redirecting https -> http I think its a bug with the server, and feel free to close this.
The reference server has been down for almost 2 years so I'm closing this.