Skip to content

Commit fc3183c

Browse files
committed
Improved network communication security for biomodels.org
Enabled Strict Transport Security (HSTS) and set explicit redirect policies for network access during file downloads and MIRIAM updates. Updated a default example URL to use HTTPS.
1 parent f9eaa59 commit fc3183c

4 files changed

Lines changed: 21 additions & 16 deletions

File tree

copasi/UI/DataModelGUI.cpp

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright (C) 2019 - 2025 by Pedro Mendes, Rector and Visitors of the
1+
// Copyright (C) 2019 - 2026 by Pedro Mendes, Rector and Visitors of the
22
// University of Virginia, University of Heidelberg, and University
33
// of Connecticut School of Medicine.
44
// All rights reserved.
@@ -218,6 +218,8 @@ void DataModelGUI::downloadFileFromUrl(const std::string & url, const std::strin
218218
mRunningThreads["downloadFileFromUrl"].success = false;
219219

220220
QNetworkAccessManager *manager = new QNetworkAccessManager(this);
221+
manager->setStrictTransportSecurityEnabled(true);
222+
manager->setRedirectPolicy(QNetworkRequest::NoLessSafeRedirectPolicy);
221223

222224
QString server = FROM_UTF8(CRootContainer::getConfiguration()->getProxyServer());
223225

@@ -739,6 +741,7 @@ bool DataModelGUI::updateMIRIAM(CMIRIAMResources & miriamResources)
739741
mpMiriamResources = &miriamResources;
740742

741743
QNetworkAccessManager *manager = new QNetworkAccessManager(this);
744+
manager->setRedirectPolicy(QNetworkRequest::SameOriginRedirectPolicy);
742745

743746
QString server = FROM_UTF8(CRootContainer::getConfiguration()->getProxyServer());
744747

@@ -798,7 +801,7 @@ void DataModelGUI::attachOutputHandler()
798801
mpDataModel->addInterface(mpOutputHandlerPlot);
799802

800803
mpOutputHandlerPlot->setOutputDefinitionVector(mpDataModel->getPlotDefinitionList());
801-
804+
802805
linkDataModelToGUI();
803806
}
804807

copasi/UI/DataModelGUI.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright (C) 2019 - 2025 by Pedro Mendes, Rector and Visitors of the
1+
// Copyright (C) 2019 - 2026 by Pedro Mendes, Rector and Visitors of the
22
// University of Virginia, University of Heidelberg, and University
33
// of Connecticut School of Medicine.
44
// All rights reserved.

copasi/UI/copasiui3window.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright (C) 2019 - 2025 by Pedro Mendes, Rector and Visitors of the
1+
// Copyright (C) 2019 - 2026 by Pedro Mendes, Rector and Visitors of the
22
// University of Virginia, University of Heidelberg, and University
33
// of Connecticut School of Medicine.
44
// All rights reserved.
@@ -4011,7 +4011,7 @@ void CopasiUI3Window::slotFileOpenFromUrl(QString url)
40114011
QString("Enter URL to open"),
40124012
QString("Please specify a URL to open (can be any supported format)"),
40134013
QLineEdit::Normal,
4014-
QString("http://www.ebi.ac.uk/biomodels/model/download/BIOMD0000000001")
4014+
QString("https://biomodels.org/model/download/BIOMD0000000001")
40154015

40164016
);
40174017

copasi/core/CCommonNameComponent.cpp

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -12,21 +12,23 @@
1212
// static
1313
const std::map< std::string, std::string > CCommonNameComponent::VectorName2ObjectType = {
1414
{"Compartments", "Compartment"},
15-
{"Metabolites", "Metabolite"},
16-
{"Reduced Model Metabolites", "Metabolite"},
17-
{"Reactions", "Reaction"},
1815
{"Events", "Event"},
19-
{"Values", "ModelValue"},
20-
{"ParameterSets", "ModelParameterSet"},
21-
{"Moieties", "Moiety"},
22-
{"ListOflayouts", "Layout"},
23-
{"TaskList", "Task"},
24-
{"ReportDefinitions", "ReportDefinition"},
25-
{"OutputDefinitions", "PlotItem"},
16+
{"Fitted Points", "Fitted Point"},
2617
{"Functions", "Function"},
18+
{"ListOfLayouts", "Layout"},
19+
{"ListOflayouts", "Layout"},
20+
{"Metabolites", "Metabolite"},
2721
{"ModelList", "CN"},
22+
{"Moieties", "Moiety"},
23+
{"OutputDefinitions", "PlotItem"},
24+
{"ParameterSets", "ModelParameterSet"},
25+
{"Reactions", "Reaction"},
26+
{"Reduced Model Metabolites", "Metabolite"},
27+
{"ReportDefinitions", "ReportDefinition"},
28+
{"TaskList", "Task"},
2829
{"Units list", "Unit"},
29-
{"Fitted Points", "Fitted Point"}};
30+
{"Values", "ModelValue"}
31+
};
3032

3133
// static
3234
std::string CCommonNameComponent::ObjectTypeFromVectorName(const std::string & name)

0 commit comments

Comments
 (0)