summaryrefslogtreecommitdiffstats
path: root/webapp
diff options
context:
space:
mode:
authorHarrison Healey <harrisonmhealey@gmail.com>2017-03-20 16:58:09 -0400
committerJoram Wilander <jwawilander@gmail.com>2017-03-20 16:58:09 -0400
commit886621824332006c6a5e8f0ef14804ef669960ff (patch)
tree730e60e5752dafa633d1234b58d610b0db9eb0a4 /webapp
parent7caab35cfab461a243eee0abe8d858f554ac0519 (diff)
downloadchat-886621824332006c6a5e8f0ef14804ef669960ff.tar.gz
chat-886621824332006c6a5e8f0ef14804ef669960ff.tar.bz2
chat-886621824332006c6a5e8f0ef14804ef669960ff.zip
Revert "PLT-3181 Added crossorigin='anonymous' to all external images (#5774)" (#5815)
This reverts commit 24848f9d6a92eb1e09189c358636fd1ba32fa6d6.
Diffstat (limited to 'webapp')
-rw-r--r--webapp/components/post_view/components/post_attachment.jsx3
-rw-r--r--webapp/components/post_view/components/post_attachment_opengraph.jsx1
-rw-r--r--webapp/components/post_view/components/post_image.jsx2
-rw-r--r--webapp/components/profile_picture.jsx2
-rw-r--r--webapp/components/profile_popover.jsx1
-rw-r--r--webapp/tests/formatting_imgs.test.jsx10
-rw-r--r--webapp/utils/markdown.jsx1
7 files changed, 5 insertions, 15 deletions
diff --git a/webapp/components/post_view/components/post_attachment.jsx b/webapp/components/post_view/components/post_attachment.jsx
index 1b2cddcd6..57335b94a 100644
--- a/webapp/components/post_view/components/post_attachment.jsx
+++ b/webapp/components/post_view/components/post_attachment.jsx
@@ -184,7 +184,6 @@ class PostAttachment extends React.Component {
author.push(
<img
className='attachment__author-icon'
- crossOrigin='anonymous'
src={data.author_icon}
key={'attachment__author-icon'}
height='14'
@@ -258,7 +257,6 @@ class PostAttachment extends React.Component {
image = (
<img
className='attachment__image'
- crossOrigin='anonymous'
src={data.image_url}
/>
);
@@ -271,7 +269,6 @@ class PostAttachment extends React.Component {
className='attachment__thumb-container'
>
<img
- crossOrigin='anonymous'
src={data.thumb_url}
/>
</div>
diff --git a/webapp/components/post_view/components/post_attachment_opengraph.jsx b/webapp/components/post_view/components/post_attachment_opengraph.jsx
index 13171202a..da85905c0 100644
--- a/webapp/components/post_view/components/post_attachment_opengraph.jsx
+++ b/webapp/components/post_view/components/post_attachment_opengraph.jsx
@@ -193,7 +193,6 @@ export default class PostAttachmentOpenGraph extends React.Component {
element = this.wrapInSmallImageContainer(
<img
className={'attachment__image attachment__image--openraph'}
- crossOrigin='anonymous'
src={imageUrl}
ref={(img) => {
this.smallImageElement = img;
diff --git a/webapp/components/post_view/components/post_image.jsx b/webapp/components/post_view/components/post_image.jsx
index 6fe954e99..9a761bfca 100644
--- a/webapp/components/post_view/components/post_image.jsx
+++ b/webapp/components/post_view/components/post_image.jsx
@@ -67,7 +67,6 @@ export default class PostImageEmbed extends React.Component {
return (
<img
className='img-div placeholder'
- crossOrigin='anonymous'
height='500px'
/>
);
@@ -76,7 +75,6 @@ export default class PostImageEmbed extends React.Component {
return (
<img
className='img-div'
- crossOrigin='anonymous'
src={this.props.link}
/>
);
diff --git a/webapp/components/profile_picture.jsx b/webapp/components/profile_picture.jsx
index 737a4400b..7a5f892db 100644
--- a/webapp/components/profile_picture.jsx
+++ b/webapp/components/profile_picture.jsx
@@ -69,7 +69,6 @@ export default class ProfilePicture extends React.Component {
width={this.props.width}
height={this.props.width}
src={this.props.src}
- crossOrigin='anonymous'
/>
<StatusIcon status={this.props.status}/>
</span>
@@ -83,7 +82,6 @@ export default class ProfilePicture extends React.Component {
width={this.props.width}
height={this.props.width}
src={this.props.src}
- crossOrigin='anonymous'
/>
<StatusIcon status={this.props.status}/>
</span>
diff --git a/webapp/components/profile_popover.jsx b/webapp/components/profile_popover.jsx
index e21716cb3..c7d45474f 100644
--- a/webapp/components/profile_popover.jsx
+++ b/webapp/components/profile_popover.jsx
@@ -182,7 +182,6 @@ export default class ProfilePopover extends React.Component {
height='128'
width='128'
key='user-popover-image'
- crossOrigin='anonymous'
/>
);
diff --git a/webapp/tests/formatting_imgs.test.jsx b/webapp/tests/formatting_imgs.test.jsx
index fac9a755f..604472671 100644
--- a/webapp/tests/formatting_imgs.test.jsx
+++ b/webapp/tests/formatting_imgs.test.jsx
@@ -11,7 +11,7 @@ describe('Markdown.Imgs', function() {
it('Inline mage', function(done) {
assert.equal(
Markdown.format('![Mattermost](/images/icon.png)').trim(),
- '<p><img src="/images/icon.png" alt="Mattermost" onload="window.markdownImageLoaded(this)" onerror="window.markdownImageLoaded(this)" class="markdown-inline-img" crossorigin="anonymous"></p>'
+ '<p><img src="/images/icon.png" alt="Mattermost" onload="window.markdownImageLoaded(this)" onerror="window.markdownImageLoaded(this)" class="markdown-inline-img"></p>'
);
done();
@@ -20,7 +20,7 @@ describe('Markdown.Imgs', function() {
it('Image with hover text', function(done) {
assert.equal(
Markdown.format('![Mattermost](/images/icon.png "Mattermost Icon")').trim(),
- '<p><img src="/images/icon.png" alt="Mattermost" title="Mattermost Icon" onload="window.markdownImageLoaded(this)" onerror="window.markdownImageLoaded(this)" class="markdown-inline-img" crossorigin="anonymous"></p>'
+ '<p><img src="/images/icon.png" alt="Mattermost" title="Mattermost Icon" onload="window.markdownImageLoaded(this)" onerror="window.markdownImageLoaded(this)" class="markdown-inline-img"></p>'
);
done();
@@ -29,7 +29,7 @@ describe('Markdown.Imgs', function() {
it('Image with link', function(done) {
assert.equal(
Markdown.format('[![Mattermost](../../images/icon-76x76.png)](https://github.com/mattermost/platform)').trim(),
- '<p><a class="theme markdown__link" href="https://github.com/mattermost/platform" rel="noreferrer" target="_blank"><img src="../../images/icon-76x76.png" alt="Mattermost" onload="window.markdownImageLoaded(this)" onerror="window.markdownImageLoaded(this)" class="markdown-inline-img" crossorigin="anonymous"></a></p>'
+ '<p><a class="theme markdown__link" href="https://github.com/mattermost/platform" rel="noreferrer" target="_blank"><img src="../../images/icon-76x76.png" alt="Mattermost" onload="window.markdownImageLoaded(this)" onerror="window.markdownImageLoaded(this)" class="markdown-inline-img"></a></p>'
);
done();
@@ -38,7 +38,7 @@ describe('Markdown.Imgs', function() {
it('Image with width and height', function(done) {
assert.equal(
Markdown.format('![Mattermost](../../images/icon-76x76.png =50x76 "Mattermost Icon")').trim(),
- '<p><img src="../../images/icon-76x76.png" alt="Mattermost" title="Mattermost Icon" width="50" height="76" onload="window.markdownImageLoaded(this)" onerror="window.markdownImageLoaded(this)" class="markdown-inline-img" crossorigin="anonymous"></p>'
+ '<p><img src="../../images/icon-76x76.png" alt="Mattermost" title="Mattermost Icon" width="50" height="76" onload="window.markdownImageLoaded(this)" onerror="window.markdownImageLoaded(this)" class="markdown-inline-img"></p>'
);
done();
@@ -47,7 +47,7 @@ describe('Markdown.Imgs', function() {
it('Image with width', function(done) {
assert.equal(
Markdown.format('![Mattermost](../../images/icon-76x76.png =50 "Mattermost Icon")').trim(),
- '<p><img src="../../images/icon-76x76.png" alt="Mattermost" title="Mattermost Icon" width="50" onload="window.markdownImageLoaded(this)" onerror="window.markdownImageLoaded(this)" class="markdown-inline-img" crossorigin="anonymous"></p>'
+ '<p><img src="../../images/icon-76x76.png" alt="Mattermost" title="Mattermost Icon" width="50" onload="window.markdownImageLoaded(this)" onerror="window.markdownImageLoaded(this)" class="markdown-inline-img"></p>'
);
done();
diff --git a/webapp/utils/markdown.jsx b/webapp/utils/markdown.jsx
index fa9c985c7..c84df0fa5 100644
--- a/webapp/utils/markdown.jsx
+++ b/webapp/utils/markdown.jsx
@@ -152,7 +152,6 @@ class MattermostMarkdownRenderer extends marked.Renderer {
out += ' height="' + dimensions[1] + '"';
}
out += ' onload="window.markdownImageLoaded(this)" onerror="window.markdownImageLoaded(this)" class="markdown-inline-img"';
- out += ' crossorigin="anonymous"';
out += this.options.xhtml ? '/>' : '>';
return out;
}