Skip to content

Commit

Permalink
When the UI is being used with a CN (dataone theme), and the user is
Browse files Browse the repository at this point in the history
logged in and downloading data with their auth token, construct the URL
from the member node base URL rather than use the resolve service. If
credentials are sent to the resolve service, the request is blocked
since it is redirected to a cross-origin resource.
  • Loading branch information
laurenwalker committed May 11, 2016
1 parent 149aa42 commit 551a3ab
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions metacatui/src/main/webapp/js/models/SolrResult.js
Original file line number Diff line number Diff line change
Expand Up @@ -207,6 +207,14 @@ define(['jquery', 'underscore', 'backbone'],
//Get info about this object
var filename = this.get("fileName") || this.get("title") || "",
url = this.get("url");

//If we are accessing objects via the resolve service, we need to find the direct URL
if(url.indexOf("/resolve/") > -1){
var dataSource = nodeModel.getMember(this.get("datasource")),
version = dataSource.readv2? "v2" : "v1";

url = dataSource.baseURL + "/" + version + "/object/" + this.get("id");
}

//Create an XHR
var xhr = new XMLHttpRequest();
Expand Down

0 comments on commit 551a3ab

Please sign in to comment.