Skip to content

Commit

Permalink
Merge remote-tracking branch 'remotes/origin/angus/hips_remote_image_…
Browse files Browse the repository at this point in the history
…load' into mylin/hips-package-test
  • Loading branch information
acdo2002 committed Jul 9, 2024
2 parents e87492a + 2f8e3ba commit 0a1a651
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
1 change: 1 addition & 0 deletions src/ImageData/CartaFitsImage.cc
Original file line number Diff line number Diff line change
Expand Up @@ -240,6 +240,7 @@ fitsfile* CartaFitsImage::OpenFile() {
fits_open_file(&fptr, _filename.c_str(), iomode, &status);

if (status) {
fits_report_error(stdout, status);
char err_text[30];
fits_get_errstatus(status, err_text);
std::string error(err_text);
Expand Down
4 changes: 3 additions & 1 deletion src/Util/File.cc
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@

#include <spdlog/fmt/fmt.h>
#include <fstream>
#include <regex>

#include "String.h"

Expand Down Expand Up @@ -35,7 +36,8 @@ bool IsCompressedFits(const std::string& filename) {
}

bool IsRemoteHttpFile(const std::string& filename) {
return filename.find("http") == 0;
const std::regex is_http_url("^https?://");
return std::regex_search(filename, is_http_url);
}

bool IsGzMagicNumber(uint32_t magic_number) {
Expand Down

0 comments on commit 0a1a651

Please sign in to comment.