xmpp.chapril.org-conversejs/src
Meitar M 76bff83ca3 Allow http: image URLs if Converse.js is loaded on an insecure origin.
Currently, in order for Converse.js to recognize a pasted URL as an
image, it must be an URL whose protocol is `https:` (`https` in the
URI.js library's notation). This is sensible, but means that any
non-HTTPS image URL is not recognized as a valid URL (and thus will not
be rendered inline, even if `show_images_inline` is set to `true`).

It is important to always check for HTTPS URLs when in a secure context
(i.e., the initial page load was requested via HTTPS) in order to ensure
that non-secured content does not mix with secured content. However, the
inverse is not true: if the original page was loaded over HTTP, then
enforcing HTTPS for images adds arguably no meaningful protection while
also breaking the `show_images_inline` feature for the edge cases where
Converse.js is deployed without HTTPS and a user pastes an HTTP URL.

This patch changes the behavior of the `isImageURL` method such that the
requirement for the pasted URL's protocol to be `https:` is enforced
only when the `window.location.protocol` itself is also `https:`. By
doing this, we ensure that secure origins (i.e., when Converse.js is
loaded over HTTPS initially) are still secured and cannot have non-HTTPS
content introduced to the page via a pasted non-HTTPS URL, however it
also allows non-HTTPS origins to render both HTTP and HTTPS image URLs.
2019-03-09 14:15:22 +02:00
..
headless Call save only once when updating a cached message 2019-03-07 17:38:07 +01:00
templates Avoid horizontal scrolling on the fullscreen login page 2019-03-07 17:47:30 +01:00
utils Allow http: image URLs if Converse.js is loaded on an insecure origin. 2019-03-09 14:15:22 +02:00
converse-autocomplete.js Let converse-autocomplete also be triggered with backspace 2019-03-05 17:59:22 +01:00
converse-bookmarks.js make it configurable whether to respect autojoin 2019-03-09 14:10:40 +02:00
converse-caps.js Replace http: with https: in conversejs.org links 2019-03-04 17:47:45 +01:00
converse-chatboxviews.js Replace http: with https: in conversejs.org links 2019-03-04 17:47:45 +01:00
converse-chatview.js Reuse XEP-359 unique and stable stanza ids for Message id. 2019-03-07 08:56:17 +01:00
converse-controlbox.js Replace http: with https: in conversejs.org links 2019-03-04 17:47:45 +01:00
converse-dragresize.js Replace http: with https: in conversejs.org links 2019-03-04 17:47:45 +01:00
converse-embedded.js Replace http: with https: in conversejs.org links 2019-03-04 17:47:45 +01:00
converse-fullscreen.js Replace http: with https: in conversejs.org links 2019-03-04 17:47:45 +01:00
converse-headline.js Replace http: with https: in conversejs.org links 2019-03-04 17:47:45 +01:00
converse-message-view.js New copyright year 2019-02-18 20:23:18 +01:00
converse-minimize.js Replace http: with https: in conversejs.org links 2019-03-04 17:47:45 +01:00
converse-modal.js Replace http: with https: in conversejs.org links 2019-03-04 17:47:45 +01:00
converse-muc-views.js allow drag & drop also in MUCs 2019-03-05 18:21:07 +01:00
converse-notification.js Replace http: with https: in conversejs.org links 2019-03-04 17:47:45 +01:00
converse-oauth.js New copyright year 2019-02-18 20:23:18 +01:00
converse-omemo.js Replace http: with https: in conversejs.org links 2019-03-04 17:47:45 +01:00
converse-profile.js Replace http: with https: in conversejs.org links 2019-03-04 17:47:45 +01:00
converse-push.js New copyright year 2019-02-18 20:23:18 +01:00
converse-register.js Replace http: with https: in conversejs.org links 2019-03-04 17:47:45 +01:00
converse-roomslist.js Replace http: with https: in conversejs.org links 2019-03-04 17:47:45 +01:00
converse-rosterview.js Replace http: with https: in conversejs.org links 2019-03-04 17:47:45 +01:00
converse-singleton.js Replace http: with https: in conversejs.org links 2019-03-04 17:47:45 +01:00
converse.js Add converse-pubsub.js 2018-12-20 21:51:16 +01:00
jquery-stub.js Remove jQuery from non-tests config 2018-01-04 12:11:03 +00:00
underscore-shim.js Use lodash.noConflict for underscore 2017-04-23 17:19:01 +00:00
website.js Use bootstrap4 for the Converse website 2018-09-18 16:15:32 +02:00