Ghost Pro broke my embeds

PDF embeds broke? Read on.

Ghost Pro broke my embeds

At some point in the last month or so, Ghost Pro (that's your host if your admin panel is *.ghost.io) switched how they served files. It used to be file uploads had urls from your own domain. Now the have urls with storage.ghost.io as the domain. All the old urls get redirected to the new urls, so nothing broken, right?

Well, no. They broke all my PDF embeds, and I don't know what else.

Unfortunately, storage.ghost.io doesn't provide the required CORS responses. So if you were using the browser to get the file and embed it, rather than just downloading it from the file card, it's not working.

There are two workarounds and one fix:

  • Ghost Pro provides a valid CORS response to allow embedding, validating the domain name is the right one before returning it in the headers. This is the fix.
  • I talked to a couple members of the Ghost team, and they kindly added a wild card response to one specific site that was having a problem. This is a workaround for this one site, so if you need it, you should ask support for it.
  • The other workaround, and one that I went with for two other client sites (because it was faster than the workaround above), is to stand up a CORS proxy. This took only a couple minutes. If you need to hit mine and we've done any work together previously, just let me know and I can add your domain to my list of valid domains. (I'm not returning a wildcard.)

Happy embedding!

Hey, before you go... If your finances allow you to keep this tea-drinking ghost and the freelancer behind her supplied with our hot beverage of choice, we'd both appreciate it!


Results here