bandwidth-hero
bandwidth-hero copied to clipboard
new URL format
old format /?url=https%3A%2F%2Fhost%2Fpath%2Ffile.jpg&jpeg=0&bw=0&l=50 new format /https/host/path/file.jpg.c50.webp solve issue #22 new format must be supported by server (bandwidth-hero-proxy)
todo: append ".c20.webp" after path but before query, not after query so input "/path/file.jpg?id=1234" becomes "/path/file.jpg.c20.webp?id=1234" on the server (bandwidth-hero-proxy), this path suffix is removed to get the original URL
here is a signed addon file for permanent install: bandwidth-hero-2.1.4-fx-c046fc1.xpi
to deploy the new proxy version to heroku, use the repository https://github.com/milahu/bandwidth-hero-proxy
version 0e4b079 of signed addon: bandwidth-hero-2.1.4-fx-0e4b079.xpi
now we can pass arbitrary parameters to the proxy server
currently, only appendPath
is used, like
/appendPath=%2Ffile.jpg/https/host/path.c50.webp
so the server can reconstruct the original URL https://host/path/file.jpg
cos decodeURIComponent("%2Ffile.jpg") == "/file.jpg"
how is this useful?
some images have an URL like //host/path/
with http-301-redirection to an image file
so we would get an image filename like ".c20.webp"
version 0e4b079 removes the trailing slash so we get "path.c20.webp"
the removed trailing slash is stored in appendPath
and re-attached on the proxy server
alternative: resolve the redirect on client side and use the final image URL