Turn your audience into a business. Publishing, memberships, subscriptions and newsletters.
Go to file
Aileen Nowak a45a91c906 🐛 Fix invalid image URLs not being cached and causing timeouts (#8986)
refs #8868

* 📐  Use request util in image-size
- swapped the usage of `got` for requests with the request util

* 💄  Use catch predicates
- Uses catch predicates instead of conditionals in `getImageSizeFromUrl`
- Return `NotFoundError` if applicable in `getImageSizeFromFilePath` as the caller function `cachedImageSizeFromUrl` is differentiating those between this error and others.

* 🐛  Fixed ImageObject URL & simplify no protocol URL logic

- Using `ImageObject` as a global var resulted in having the `url` property being the same for all requests coming in.
- The logic that checked for an existing protocol (e. g. gravatar URLs) was overly complicated. Refactored it to be more simple.
- Passing the correct value to `fetchDimensionsFromBuffer` as the population of `imageObject.url` happens there. These are used in our structured data and need to be full URLs (in case of locally stored files) or the original URL (in case of URLs missing the protocol)
- Added two more debug logs in `getCachedImageSizeFromUrl` so it's logged when an image is added to the cache even tho it was returned as error.

* 👀  Differentiate error codes between request and storage

* 🔥  Remove not needed `Promise.resolve()`

We're always resolving the result in `getCachedImageSizeFromUrl`, so there's no need to return the values with a `Promise.resolve()`. The caller fn uses waits for the Promises to be fulfilled.

* ☂️  Wrap already rejected predicate errors in catch all

* Use errorDetails instead of context

* ☂️  Support /assets/ image paths

- adds a guard that checks the image URL for `/assets/` in the beginning and passes a completed URL to the request util to try and fetch the image size
- adds tests
2017-09-12 12:53:18 +01:00
.github Remove wishlist links (#8981) 2017-09-07 09:04:33 +02:00
content Upgrading Casper to 2.1.2 2017-09-12 18:48:27 +07:00
core 🐛 Fix invalid image URLs not being cached and causing timeouts (#8986) 2017-09-12 12:53:18 +01:00
.editorconfig Various post-repo-split cleanup (#6910) 2016-07-12 11:55:46 -06:00
.gitignore 🛠 🙈 Rename ghost-url.js to ghost-sdk.js (#8767) 2017-07-28 18:23:32 +04:00
.gitmodules Add Admin-Client as submodule at core/client 2016-05-19 14:20:18 +01:00
.jscsrc Various post-repo-split cleanup (#6910) 2016-07-12 11:55:46 -06:00
.jshintrc 🎨 jsHint: support ES6 features (#7920) 2017-01-31 13:13:23 +00:00
.npmignore 🐛 Removed Casper's gulpfile from npmignore (#8880) 2017-08-15 09:52:34 +01:00
.travis.yml recommend node v6 (#8674) 2017-07-11 14:05:38 +01:00
Gruntfile.js Used ghost-ignition.debug, removed debug dep (#8881) 2017-08-15 18:29:27 +07:00
index.js Used ghost-ignition.debug, removed debug dep (#8881) 2017-08-15 18:29:27 +07:00
LICENSE 2017 (#7819) 2017-01-04 10:05:57 +00:00
MigratorConfig.js 🎨 optimise requires for MigratorConfig (#8088) 2017-03-02 16:02:23 +00:00
package.json Version bump to 1.8.4 2017-09-07 14:45:56 +02:00
PRIVACY.md Update config location and docs url in PRIVACY (#8817) 2017-08-01 19:21:38 -04:00
README.md Remove wishlist links (#8981) 2017-09-07 09:04:33 +02:00
SECURITY.md Update SECURITY.md 2016-01-13 18:22:09 +02:00
yarn.lock Re-instate mobiledoc dom rendering with bypass of SimpleDOM parsing (#8937) 2017-08-31 12:09:02 +02:00

Ghost Build status

The project is maintained by a non-profit organisation called the Ghost Foundation, along with an amazing group of independent contributors. We're trying to make publishing software that changes the shape of online journalism.

NOTE: If youre stuck, cant get something working or need some help, please head on over and join our Slack community rather than opening an issue.

 

Ghost

 

Hosting a live Ghost site

Ghost(Pro)

The easiest way to deploy Ghost is with our official Ghost(Pro) managed service. You can have a fresh instance up and running in a couple of clicks with a worldwide CDN, backups, security and maintenance all done for you.

Not only will it save you hours of maintenance per month, but all revenue goes to the Ghost Foundation, which funds the maintenance and further development of Ghost itself. So youll be supporting open source software and getting a great service at the same time! Talk about win/win. 🏆

Self-Hosters

Other options are also available if you prefer playing around with servers by yourself, of course. The freedom of choice is in your hands.

Theme Developers

If you are developing a Ghost theme for your own site or creating themes for others to use we recommend installing Ghost on your own local machine. Luckily we have a brand new Ghost CLI to make this really easy 😄

Contributors & Advanced Developers

For anyone wishing to contribute to Ghost or to hack/customise core files we recommend following our development setup guides:

Staying Up to Date

When a new version of Ghost comes out, you'll want to look over these upgrade instructions for what to do next.

You can talk to other Ghost users and developers in our public Slack team (it's pretty awesome).

New releases are announced on the dev blog. You can subscribe by email or follow @TryGhost_Dev on Twitter, if you prefer your updates bite-sized and facetious. 🎷🐢

 

Copyright & License

Copyright (c) 2013-2017 Ghost Foundation - Released under the MIT license. Ghost and the Ghost Logo are trademarks of Ghost Foundation Ltd. Please see our trademark policy for info on acceptable usage.