From 007e65cdfe0432cf00e7f811bb002f04fa6d2846 Mon Sep 17 00:00:00 2001 From: leonarski_f Date: Sat, 11 Jul 2026 15:10:08 +0200 Subject: [PATCH] viewer: accept https:// endpoints and add an http/https selector to the connect dialog - Route https:// URLs to the HTTP reader (LoadFile_i scheme check), not only http://. - Replace the fixed "http://" label in the Open HTTP Connection dialog with a small http/https combo box and build the URL from the chosen scheme. Co-Authored-By: Claude Opus 4.8 --- viewer/JFJochImageReadingWorker.cpp | 2 +- viewer/JFJochViewerMenu.cpp | 11 +++++++++-- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/viewer/JFJochImageReadingWorker.cpp b/viewer/JFJochImageReadingWorker.cpp index 356f36ba..8c503241 100644 --- a/viewer/JFJochImageReadingWorker.cpp +++ b/viewer/JFJochImageReadingWorker.cpp @@ -207,7 +207,7 @@ void JFJochImageReadingWorker::LoadFile_i(const QString &filename, qint64 image_ std::shared_ptr dataset; auto start = std::chrono::high_resolution_clock::now(); - if (filename.startsWith("http://")) { + if (filename.startsWith("http://") || filename.startsWith("https://")) { http_mode = true; http_reader.ReadURL(filename.toStdString()); total_images = http_reader.GetNumberOfImages(); diff --git a/viewer/JFJochViewerMenu.cpp b/viewer/JFJochViewerMenu.cpp index e69ade56..8d039375 100644 --- a/viewer/JFJochViewerMenu.cpp +++ b/viewer/JFJochViewerMenu.cpp @@ -12,6 +12,7 @@ #include #include #include +#include #include #include @@ -177,7 +178,12 @@ void JFJochViewerMenu::openHttpSelected() { dialog.setMinimumWidth(400); QGridLayout *layout = new QGridLayout(&dialog); - layout->addWidget(new QLabel("http://"), 0, 0); + + // Scheme selector: plain HTTP (broker directly) or HTTPS (e.g. broker behind a reverse proxy). + QComboBox *schemeCombo = new QComboBox(&dialog); + schemeCombo->addItem("http://"); + schemeCombo->addItem("https://"); + layout->addWidget(schemeCombo, 0, 0); layout->addWidget(new QLabel(":"), 0, 2); QLineEdit *hostEdit = new QLineEdit(&dialog); @@ -211,7 +217,8 @@ void JFJochViewerMenu::openHttpSelected() { dialog.setLayout(layout); if (dialog.exec() == QDialog::Accepted) { - QString url = QString("http://%1:%2") + QString url = QString("%1%2:%3") + .arg(schemeCombo->currentText()) .arg(hostEdit->text()) .arg(portSpinBox->value());