Closed sweepies closed 7 years ago
The http console (browser) errors are from the content security policy (ref, ref). Basically it is refusing to apply an inline style to that element.
It looks like github's camo applies a slightly broader Content security policy header in their responses. I believe this may be what you are experiencing. To confirm, you could try starting go-camo with a -H
option to override that particular default header, and see if that resolves your issue.
Example:
go-camo -k <something> -H "Content-Security-Policy: default-src 'none'; img-src data:; style-src 'unsafe-inline'"
If it does, I would not object to changing the default header to match that of github's camo implementation. It does seem a bit more user friendly.
I see, that does in fact fix it. Thanks!
I've created a pull request for you: #12
closing this issue. I'll do a build and tag a release. thanks!
I've noticed with GitHub's and other language implementations of Camo, as well as direct linking images, it sets the body style to 'margin: 0px'. With my go-camo setup however it does not. This obviously is not a big deal but it might cause some weird behaviour.
Imgur image:
go-camo image:
As you can see by navigating to those links, the Camo version has a small margin to the left and top of the image, and I haven't seen something like this anywhere else.
It's also probably worth noting that it throws these errors to the HTTP console, which I'm not sure what to do about: