GetDKAN / dkan2

Deprecated: please use the 2.x branch of the dkan repo
https://github.com/GetDKAN/dkan
GNU General Public License v2.0
18 stars 16 forks source link

Replace protocol as well as hostname when generating download URLs #412

Open grugnog opened 2 years ago

grugnog commented 2 years ago

https://github.com/GetDKAN/dkan2/blob/master/modules/dkan_common/src/UrlHostTokenResolver.php#L18 replaces the hostname, but not the protocol. This means that files uploaded over http will be served over http and the same for https, even if the host serving the files is using the opposite protocol. This can cause insecure links on https servers (that have moved from http) or broken links if a server used to support https but no longer does.