Skip to content

Commit

Permalink
Merge pull request #304 from appukuttan-shailesh/master
Browse files Browse the repository at this point in the history
Update CORS proxy
  • Loading branch information
appukuttan-shailesh committed Apr 1, 2021
2 parents feab16a + 78037ff commit dca1906
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 5 deletions.
2 changes: 0 additions & 2 deletions apps/validation_framework_v2/src/ResultGraphs.js
Expand Up @@ -19,8 +19,6 @@ import LoadingIndicator from "./LoadingIndicator";
import ResultDetail from './ResultDetail';
import Theme from './theme';



function ResultsFiguresTestIntance(props) {
const Plot = createPlotlyComponent(Plotly);
var traces = [];
Expand Down
5 changes: 2 additions & 3 deletions apps/validation_framework_v2/src/ResultRelatedFiles.js
Expand Up @@ -12,6 +12,7 @@ import Theme from './theme';
import ContextMain from './ContextMain';
import { copyToClipboard } from './utils';
import { withSnackbar } from 'notistack';
import { corsProxy } from "./globals";

var filesize = require("filesize");

Expand Down Expand Up @@ -67,9 +68,7 @@ class ResultFile extends React.Component {
}
// Since Collaboratory v2 storage and CSCS storage gives CORS related issues,
// we use an intermediate proxy server to resolve this
// previously used https://cors-anywhere.herokuapp.com/ - but now has request limits
// other options: https://cors-fixer.herokuapp.com/, https://cors-handler.herokuapp.com/
query_url = "https://cors-clear.herokuapp.com/" + query_url
query_url = corsProxy + query_url;

axios.head(query_url, config)
.then(res => {
Expand Down
5 changes: 5 additions & 0 deletions apps/validation_framework_v2/src/globals.js
Expand Up @@ -22,6 +22,11 @@ export const displayValid = ["Only Models", "Models and Tests", "Only Tests"];
export const queryValid = ["model_id", "model_alias", "model_instance_id", "test_id", "test_alias", "test_instance_id", "result_id"];
export const ADMIN_PROJECT_ID = "model-validation";

// Since Collaboratory v2 storage and CSCS storage gives CORS related issues
export const corsProxy = "https://corsproxy-sa.herokuapp.com/";
// previously used https://cors-anywhere.herokuapp.com/ - but now has request limits
// other options: https://cors-clear.herokuapp.com/, https://cors-fixer.herokuapp.com/, https://cors-handler.herokuapp.com/

export const updateHash = (value) => {
window.location.hash = value;
if (isFramedApp) {
Expand Down

0 comments on commit dca1906

Please sign in to comment.