Skip to content

Commit

Permalink
Merge pull request #1255 from DennisHeimbigner/dap4proto.dmh
Browse files Browse the repository at this point in the history
Fix handling of the dap4: protocol.
  • Loading branch information
DennisHeimbigner authored Nov 6, 2023
2 parents 027414a + cdd73b0 commit 26ccc20
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 2 deletions.
2 changes: 0 additions & 2 deletions dap4/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,9 @@ test {
include 'dap4/test/TestParserCE.class'
include 'dap4/test/TestRaw.class'
include 'dap4/test/TestDap4Url.class'
if(false) { // disable selected dap4 tests for now
include 'dap4/test/TestRemote.class'
include 'dap4/test/TestConstraints.class'
include 'dap4/test/TestHyrax.class'
}

dependsOn('farmBeforeIntegrationTest')
finalizedBy('farmAfterIntegrationTest')
Expand Down
13 changes: 13 additions & 0 deletions dap4/src/main/java/dap4/core/util/XURI.java
Original file line number Diff line number Diff line change
Expand Up @@ -265,6 +265,19 @@ public void insertQueryField(String key, String newval) {
rebuildQuery();
}

/**
* Allow fragment fields to be inserted
*
* @param key
* @param newval
* @return previous value or this value if key not set
*/
public void insertFragmentField(String key, String newval) {
// Watch out in case there is no query
this.fragfields = insertAmpField(key, newval, parent.getFragment());
rebuildQuery();
}

/**
* Allow queryfields to be removed
*
Expand Down
7 changes: 7 additions & 0 deletions dap4/src/main/java/dap4/dap4lib/cdm/nc2/DapNetcdfFile.java
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,13 @@ public DapNetcdfFile(String location, CancelTask cancelTask) throws IOException
} catch (URISyntaxException use) {
throw new IOException(use);
}
// We need to convert the protocol to #dap4
if ("dap4".equalsIgnoreCase(xuri.getScheme())) {
xuri.setScheme("https"); // Note that this should be https, but
// test.opendap.org still uses http; one
// hopes that other servers are setup to
// redirect http: to https:
}
this.dsplocation = xuri.assemble(XURI.URLQUERY);
cancel = (cancelTask == null ? nullcancel : cancelTask);

Expand Down

0 comments on commit 26ccc20

Please sign in to comment.