]> TLD Linux GIT Repositories - packages/poldek.git/blobdiff - poldek-https-redirect.patch
- https-redirect.patch from PLD
[packages/poldek.git] / poldek-https-redirect.patch
diff --git a/poldek-https-redirect.patch b/poldek-https-redirect.patch
new file mode 100644 (file)
index 0000000..4a7cb8c
--- /dev/null
@@ -0,0 +1,15 @@
+--- poldek-0.42.2/vfile/vfffmod.c.orig 2020-01-25 22:59:59.000000000 +0100
++++ poldek-0.42.2/vfile/vfffmod.c      2023-10-19 14:05:44.263325854 +0200
+@@ -269,10 +269,10 @@
+         char topath[PATH_MAX + 128], *topathp = vreq.redirected_to;
+         int  foreign_proto = 0;
+-        n_assert(cn->proto == VCN_PROTO_HTTP);
++        n_assert(cn->proto == VCN_PROTO_HTTP || cn->proto == VCN_PROTO_HTTPS);
+         if (*vreq.redirected_to == '/') {
+-            snprintf(topath, sizeof(topath), "http://%s%s", req->host,
++            snprintf(topath, sizeof(topath), "http%s://%s%s", cn->proto == VCN_PROTO_HTTPS ? "s" : "" , req->host,
+                      vreq.redirected_to);
+             topathp = topath;
+         } else if (strncmp(vreq.redirected_to, "http://", 7) != 0)