mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
IDEA-163490 Force the use of https in connections to PivotalTracker
Old Apache HttpClient doesn't allow to enable following redirects for HTTP requests containing entities. Instead I replace "http:" with "https:" in server URLs of existing connectors so as not to make their users re-configure everything or modify the address manually.
This commit is contained in:
+10
-1
@@ -51,7 +51,7 @@ public class PivotalTrackerRepository extends BaseRepositoryImpl {
|
||||
|
||||
{
|
||||
if (StringUtil.isEmpty(getUrl())) {
|
||||
setUrl("http://www.pivotaltracker.com");
|
||||
setUrl("https://www.pivotaltracker.com");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -292,6 +292,7 @@ public class PivotalTrackerRepository extends BaseRepositoryImpl {
|
||||
@Override
|
||||
protected void configureHttpMethod(final HttpMethod method) {
|
||||
method.addRequestHeader("X-TrackerToken", myAPIKey);
|
||||
//method.setFollowRedirects(true);
|
||||
}
|
||||
|
||||
public String getProjectId() {
|
||||
@@ -384,4 +385,12 @@ public class PivotalTrackerRepository extends BaseRepositoryImpl {
|
||||
protected int getFeatures() {
|
||||
return super.getFeatures() | BASIC_HTTP_AUTHORIZATION | STATE_UPDATING;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setUrl(String url) {
|
||||
if (url.startsWith("http:")) {
|
||||
url = "https:" + StringUtil.trimStart(url, "http:");
|
||||
}
|
||||
super.setUrl(url);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user