-
Notifications
You must be signed in to change notification settings - Fork 2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Reader/PostNorm: Leave https image srcs from non-wpcom hosts alone. #2922
Conversation
Fixes #790 |
cc @designsimply as the OP |
1aa5cd3
to
370abeb
Compare
@@ -101,6 +101,12 @@ function maxWidthPhotonishURL( imageURL, width ) { | |||
return imageURL; | |||
} | |||
|
|||
if ( ! ( endsWith( parsedURL.host, 'wp.com' ) || |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Perhaps we could pop these domain endings into an array rather than doing three separate comparisons?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
&possibly wrapped in a isPhotonableHost
method for extra clarity?
Going to take a different tact with this one. Automattic/photon.js#5 will allow us to fetch the github (and other secure content) images via photon. I'd rather do that than open us up to pulling images from just anywhere. When that lands, this PR will change to just update the photon dep. No other changes should be necessary. |
370abeb
to
a9f595e
Compare
a9f595e
to
b2b578a
Compare
Photon landed, PR updated. So far, so good. Need to check the few places we use photon handle the new null return. |
cc @gwwar could you take a peek at the shrinkwrap change here? I updated it using clingwrap. Seems odd that it removed so much from each entry? |
See: goodeggs/clingwrap#1 and npm/npm#3581 for more info. |
@blowery with regards to the missing fields, I think we should be ok since we don't have any private registries. 👍 I tested the npm install from a clean state and looks good. |
Looks good to me |
@gwwar huh. that all led me to https://www.npmjs.com/package/shonkwrap |
Reader/PostNorm: Leave https image srcs from non-wpcom hosts alone.
This fixes images coming from private WPCOM sites and images from places like github and medium which block photon. It also fixes https images that rely on querystring arguments that photon cannot understand.
See #790 for a repro case