Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

IDMapperUniprot does not follow relative redirects #52

Closed
stain opened this issue Aug 29, 2017 · 0 comments
Closed

IDMapperUniprot does not follow relative redirects #52

stain opened this issue Aug 29, 2017 · 0 comments

Comments

@stain
Copy link
Member

stain commented Aug 29, 2017

When building 2.2.0 org.bridgedb.webservice.uniprot.Test fails with:

java.lang.IllegalArgumentException: host parameter is null
        at org.apache.commons.httpclient.HttpConnection.setHost(HttpConnection.java:249)
        at org.apache.commons.httpclient.SimpleHttpConnectionManager.getConnectionWithTimeout(SimpleHttpConnectionManager.java:189)
        at org.apache.commons.httpclient.HttpMethodDirector.executeMethod(HttpMethodDirector.java:153)
        at org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java:397)
        at org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java:323)
        at org.bridgedb.webservice.uniprot.IDMapperUniprot.runQuery(IDMapperUniprot.java:329)
        at org.bridgedb.webservice.uniprot.IDMapperUniprot.runMappingQuery(IDMapperUniprot.java:125)
        at org.bridgedb.webservice.uniprot.IDMapperUniprot.mapID(IDMapperUniprot.java:189)
        at org.bridgedb.webservice.uniprot.Test.testBasic(Test.java:40)

This is caused by the HttpStatus.SC_MOVED_TEMPORARILY handling not resolving relative URIs like /mapping/M20170829A7434721E10EE6586998A056CCD0537EF5E350T.tab according to the requested URI.

For some reason this uses method.setFollowRedirects(false);. The fix is to use URI.resolve() to ensure correct parsing of any relative URI.

@stain stain closed this as completed in 8730933 Aug 29, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant