Fixes issue with Calibre web expecting SSL (#347)
http urls now work with Calibre web --------- Co-authored-by: Dave Allie <dave@daveallie.com>
This commit is contained in:
@@ -2,6 +2,8 @@
|
||||
|
||||
namespace UrlUtils {
|
||||
|
||||
bool isHttpsUrl(const std::string& url) { return url.rfind("https://", 0) == 0; }
|
||||
|
||||
std::string ensureProtocol(const std::string& url) {
|
||||
if (url.find("://") == std::string::npos) {
|
||||
return "http://" + url;
|
||||
|
||||
@@ -3,6 +3,11 @@
|
||||
|
||||
namespace UrlUtils {
|
||||
|
||||
/**
|
||||
* Check if URL uses HTTPS protocol
|
||||
*/
|
||||
bool isHttpsUrl(const std::string& url);
|
||||
|
||||
/**
|
||||
* Prepend http:// if no protocol specified (server will redirect to https if needed)
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user