Comments (8)
Content-Encoding: gzip
This isn't really a content-type/"doesn't work" issue, because there's no such thing as "image/svg+xml+gzip", which is why .svgz
doesn't do anything useful.
I'd also like to point out that browser support for svg interpretation/rendering and browser support for gzip decompression are completely separate features. Content-Encoding: gzip
could be used with basically ~anything, including gzip'ed plaintext, html, png, webm, etc...
If this feature were implemented, it would be more of a "store and replay POST headers on GET"; something like:
$ curl -F [email protected] -H "Content-Encoding: gzip" -H "Content-Type: image/svg+xml" https://ptpb.pw
$ curl -D- https://ptpb.pw/my.extension-would-be-ignored-in-this-case
...
Content-Type: image/svg+xml
Content-Encoding: gzip
...
from pb.
This is something I've thought pb has needed for awhile, but nobody ever requested it or presented a meaningful use-case.
from pb.
implemented in: a8a1706
deployed via: fb0d969a-f779-4411-b634-1ddd7aa8292d
Example:
➜ ~ curl -F c=@- -H 'x-foo-bar: spam' https://ptpb.pw <<< gook2134
date: 2019-01-07T03:13:36.533698+00:00
digest: 93c1103b89d5e04ab2f4a21601f16a9df53f7289
long: AJPBEDuJ1eBKsvSiFgHxap31P3KJ
short: P3KJ
size: 9
status: created
url: https://ptpb.pw/P3KJ
uuid: 9c54b52e-1e79-4b7a-b0e9-2c004088d7da
➜ ~ curl https://ptpb.pw/P3KJ
gook2134
➜ ~ curl -D- https://ptpb.pw/P3KJ
HTTP/1.1 200 OK
Server: openresty/1.13.6.2
Date: Mon, 07 Jan 2019 03:13:43 GMT
Content-Type: text/plain; charset=utf-8
Content-Length: 9
Connection: keep-alive
x-foo-bar: spam
x-varnish: 32774
ETag: "paste-93c1103b89d5e04ab2f4a21601f16a9df53f7289"
Cache-Control: public, max-age=43200
X-Varnish: 13 11
Age: 2
Via: 1.1 varnish (Varnish/6.0)
Accept-Ranges: bytes
gook2134
In your case, you want to add -H 'content-encoding: gzip'
to your regular curl arguments.
While I think it would be nice to accept content-type
in this way as well, due to past technical debt actually doing this isn't easy.
from pb.
I also re-uploaded https://ptpb.pw/9sCt.svg to demonstrate:
curl -F [email protected] -H 'content-encoding: gzip' https://ptpb.pw
There is no difference between https://ptpb.pw/9sCt.svg
and https://ptpb.pw/9sCt.svgz
, both in the response from pb, and the resulting behavior from browsers.
from pb.
As another example, here's a png with content-disposition: attachment
(will trigger download dialog instead of rendering):
from pb.
And, just for fun, here is a gzip'ed webm:
$ TheFatRat\ -\ MAYDAY\ feat.\ Laura\ Brehm-DT61L8hbbJ4.webm | gzip | curl -F c=@- -H 'content-encoding: gzip' https://ptpb.pw
date: 2019-01-07T03:37:53.337885+00:00
digest: af5501bf58f25d07410aa7731dca80a0088d7e06
long: AK9VAb9Y8l0HQQqncx3KgKAIjX4G
short: jX4G
size: 22982644
status: created
url: https://ptpb.pw/jX4G
uuid: 7a29ec60-dc00-47d8-836f-02359b80bdb5
$ wc TheFatRat\ -\ MAYDAY\ feat.\ Laura\ Brehm-DT61L8hbbJ4.webm
90609 512571 23030577 TheFatRat - MAYDAY feat. Laura Brehm-DT61L8hbbJ4.webm
amusing reduction 23030577 -> 22982644, what a savings
from pb.
Interestingly, varnish is trying to be "smart", which confounds testing:
$ curl -s -D- https://ptpb.pw/McM6 | wc
1298 12249 109818
$ curl -H 'Accept-Encoding: gzip' -s -D- https://ptpb.pw/McM6 | wc
121 571 22832
Fixed in 57eca7f1-6e93-43f6-92ed-ac91434c8851
.
from pb.
$ curl -s https://ptpb.pw/jX4G | mpv /dev/stdin
Playing: /dev/stdin
Failed to recognize file format.
Exiting... (Errors when loading file)
$ curl -s https://ptpb.pw/jX4G | gzip -d | mpv /dev/stdin
Playing: /dev/stdin
[mkv] SeekHead position beyond end of file - incomplete file?
(+) Video --vid=1 (*) (vp9 1920x1080 29.970fps)
(+) Audio --aid=1 --alang=eng (*) (vorbis 2ch 44100Hz)
AO: [pulse] 44100Hz stereo 2ch float
VO: [gpu] 1920x1080 yuv420p
AV: 00:00:01 / 00:04:07 (0%) A-V: 0.000 Cache: 124s+15MB
Exiting... (Quit)
And indeed, https://ptpb.pw/jX4G.webm works in firefox/chromium automatically.
from pb.
Related Issues (20)
- IP upload black/whitelist HOT 1
- Pygments styles not applied propperly for dark background styles HOT 2
- ptpb.pw has AAAA record but address is not reachable HOT 2
- Web form doesn't give usable data HOT 2
- Can we append to an existing url ? HOT 2
- ptpb.pw data retention policy HOT 2
- Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-req-build-x6n4bc2r/ HOT 2
- ptpb.pw is out of disk space HOT 4
- What does "ptpb.pw" mean? HOT 1
- how to add the command executed in the paste HOT 9
- update won't work HOT 1
- ptpb.pw 500 Internal Server Error on uploading png HOT 11
- ptpb.pw permanent shutdown HOT 38
- ModuleNotFoundError: No module named 'werkzeug' when creating new container HOT 6
- building pb from a non-git copy HOT 14
- Site is down HOT 5
- Sqlite Option HOT 3
- Docker-compose deployment HOT 3
- Question: Private paste vs Non-private paste HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pb.