This server is a proxy to GitLab to serve SVG files.
The problem with linking directly is with the HTTP headers. GitLab sends Content-Disposition: attachment
, which makes the browser try to download the image instead of displaying it.
GitLab does allow hotlinking.
It should have been simple, but for some unknown reason (probably caching conflicts), I needed to delete a lot more headers when running in production.
It is a standard Dockerfile
. The only tricky bit is getting the port to be configurable. See the run.sh
for the parameters I use to run locally for development.
# API with raw suffix: content-disposition: attachment; filename="Samsung.svg"; filename*=UTF-8''Samsung.svg
curl --verbose https://gitlab.com/api/v4/projects/celebdor%2Fdesign/repository/files/logos%2FSamsung.svg/raw?ref=master
# raw subdirectory: content-disposition: attachment
curl --verbose https://gitlab.com/celebdor/design/raw/master/logos/Samsung.svg
- cleanup 50x error page
- is redirect.html ever used?
- switch to custom server using fiber