Skip to content

Commit

Permalink
Patch for https connections
Browse files Browse the repository at this point in the history
  • Loading branch information
Jay Guo committed Aug 25, 2017
1 parent 06ba579 commit b84ef13
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 3 deletions.
18 changes: 16 additions & 2 deletions source/src/org/ckan/ckan.java
Expand Up @@ -197,7 +197,14 @@ public void dispose(StepMetaInterface smi, StepDataInterface sdi) {
}

public boolean newDataStoreResorce(List<Field> fields) {
Client ckanClient = new Client( new Connection(ckanDomain), ckanApiKey);
int port;
if (ckanDomain.toLowerCase().startsWith("https://")) {
port = 443;
}
else {
port= 80;
}
Client ckanClient = new Client( new Connection(ckanDomain, port), ckanApiKey);

try {
DataStore ds = new DataStore();
Expand Down Expand Up @@ -239,7 +246,14 @@ public boolean newDataStoreResorce(List<Field> fields) {
}

public boolean uploadDataStore(List<LinkedHashMap<String, Object>> records) {
Client ckanClient = new Client( new Connection(ckanDomain), ckanApiKey);
int port;
if (ckanDomain.toLowerCase().startsWith("https://")) {
port = 443;
}
else {
port= 80;
}
Client ckanClient = new Client( new Connection(ckanDomain, port), ckanApiKey);

try {
DataStore ds = new DataStore();
Expand Down
2 changes: 1 addition & 1 deletion source/src/org/ckan/ckanDialog.java
Expand Up @@ -416,7 +416,7 @@ private void ok()
stepname = wStepname.getText(); // return value

String domain = wDomain.getText().trim();
if (!domain.startsWith("http://")) {
if (!domain.startsWith("http://") && !domain.startsWith("https://")) {
domain = "http://" + domain;
}
while (domain.endsWith("/")) {
Expand Down
Binary file modified steps/ckan-datastore-plugin/ckan_datastore.jar
Binary file not shown.

0 comments on commit b84ef13

Please sign in to comment.