[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] 100/119: manual application of x-gzip content encoding
From: |
Eric Schulte |
Subject: |
[elpa] 100/119: manual application of x-gzip content encoding |
Date: |
Mon, 10 Mar 2014 16:57:53 +0000 |
eschulte pushed a commit to branch master
in repository elpa.
commit 12304e97b3ffd10fa1d7ace70241b83f756f830a
Author: Eric Schulte <address@hidden>
Date: Thu Jan 16 18:40:55 2014 -0700
manual application of x-gzip content encoding
---
examples/016-content-encoding-gzip.el | 30 ++++++++++++++++++++++++++++++
1 files changed, 30 insertions(+), 0 deletions(-)
diff --git a/examples/016-content-encoding-gzip.el
b/examples/016-content-encoding-gzip.el
new file mode 100644
index 0000000..2d0d21e
--- /dev/null
+++ b/examples/016-content-encoding-gzip.el
@@ -0,0 +1,30 @@
+;;; content-encoding-gzip.el -- manual application of gzip content encoding
+(ws-start
+ (lambda (request)
+ (cl-flet ((gzip (s)
+ (with-temp-buffer
+ (insert s)
+ (shell-command-on-region
+ (point-min) (point-max) "gzip" nil 'replace)
+ (buffer-string))))
+ (with-slots (process headers) request
+ (ws-response-header process 200
+ '("Content-type" . "text/plain; charset=utf-8")
+ '("Content-Encoding" . "x-gzip"))
+ (let ((s "Lorem ipsum dolor sit amet, consectetuer adipiscing elit.
Donec
+hendrerit tempor tellus. Donec pretium posuere tellus. Proin quam
+nisl, tincidunt et, mattis eget, convallis nec, purus. Cum sociis
+natoque penatibus et magnis dis parturient montes, nascetur
+ridiculus mus. Nulla posuere. Donec vitae dolor. Nullam tristique
+diam non turpis. Cras placerat accumsan nulla. Nullam rutrum. Nam
+vestibulum accumsan nisl.
+
+Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Donec
+hendrerit tempor tellus. Donec pretium posuere tellus. Proin quam
+nisl, tincidunt et, mattis eget, convallis nec, purus. Cum sociis
+natoque penatibus et magnis dis parturient montes, nascetur
+ridiculus mus. Nulla posuere. Donec vitae dolor. Nullam tristique
+diam non turpis. Cras placerat accumsan nulla. Nullam rutrum. Nam
+vestibulum accumsan nisl."))
+ (process-send-string process (gzip s))))))
+ 9016)
- [elpa] 99/119: serve files with htmlize Emacs fontification, (continued)
- [elpa] 99/119: serve files with htmlize Emacs fontification, Eric Schulte, 2014/03/10
- [elpa] 97/119: added ws-stop-all convenience function, Eric Schulte, 2014/03/10
- [elpa] 89/119: authorization helper, Eric Schulte, 2014/03/10
- [elpa] 92/119: simpler handler in example, Eric Schulte, 2014/03/10
- [elpa] 102/119: updated content- transfer-encoding notes, Eric Schulte, 2014/03/10
- [elpa] 103/119: set Content-length when serving files, Eric Schulte, 2014/03/10
- [elpa] 95/119: better ws-send-directory-list, Eric Schulte, 2014/03/10
- [elpa] 106/119: TODO Content and Transfer encodings, Eric Schulte, 2014/03/10
- [elpa] 104/119: tweak notes, Eric Schulte, 2014/03/10
- [elpa] 108/119: test chunked/gzipped transfer/content encodings, Eric Schulte, 2014/03/10
- [elpa] 100/119: manual application of x-gzip content encoding,
Eric Schulte <=
- [elpa] 101/119: manual application of chunked transfer encoding, Eric Schulte, 2014/03/10
- [elpa] 107/119: support for content and transfer encodings, Eric Schulte, 2014/03/10
- [elpa] 109/119: doc for new content/transfer encoding helpers, Eric Schulte, 2014/03/10
- [elpa] 110/119: automatically generate dir file w/install-info, Eric Schulte, 2014/03/10
- [elpa] 113/119: Fix WebSocket varint length encoding, Eric Schulte, 2014/03/10
- [elpa] 117/119: adding .elpaignore to keep extra file from package, Eric Schulte, 2014/03/10
- [elpa] 115/119: gnu elpa wants a "Maintainer:" pseudo-header, Eric Schulte, 2014/03/10
- [elpa] 114/119: dangerous example; web-socket comint shell buffer, Eric Schulte, 2014/03/10
- [elpa] 105/119: mention `make check' in README, Eric Schulte, 2014/03/10
- [elpa] 116/119: assign copyright to FSF, Eric Schulte, 2014/03/10