[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] 67/119: test large file upload (w/o network chunking)
From: |
Eric Schulte |
Subject: |
[elpa] 67/119: test large file upload (w/o network chunking) |
Date: |
Mon, 10 Mar 2014 16:57:38 +0000 |
eschulte pushed a commit to branch master
in repository elpa.
commit a09c4ec04fbd0afa1d39d082c7c6794557843ac1
Author: Eric Schulte <address@hidden>
Date: Sun Jan 5 12:04:26 2014 -0700
test large file upload (w/o network chunking)
---
web-server-test.el | 29 +++++++++++++++++++++++++++++
1 files changed, 29 insertions(+), 0 deletions(-)
diff --git a/web-server-test.el b/web-server-test.el
index 3a889ce..ee80ae9 100644
--- a/web-server-test.el
+++ b/web-server-test.el
@@ -208,4 +208,33 @@ Connection: keep-alive
(cons :BASIC (cons username password)))))
(ws-stop server))))
+(ert-deftest ws/parse-large-file-upload ()
+ "Test that `ws-parse-request' can handle at large file upload.
+At least when it comes in a single chunk."
+ (let* ((long-string (mapconcat #'int-to-string (number-sequence 0 20000) "
"))
+ (long-request
+ (format "POST / HTTP/1.1
+User-Agent: curl/7.34.0
+Host: localhost:9008
+Accept: */*
+Content-Length: 9086
+Expect: 100-continue
+Content-Type: multipart/form-data; boundary=----------------e458fb665704290b
+
+------------------e458fb665704290b
+Content-Disposition: form-data; name=\"file\"; filename=\"-\"
+Content-Type: application/octet-stream
+
+%s
+------------------e458fb665704290b--
+
+" long-string))
+ (server (ws-start nil ws-test-port))
+ (request (make-instance 'ws-request)))
+ (unwind-protect
+ (progn (ws-parse-request request long-request)
+ (should (string= long-string
+ (cdr (assoc 'content (cdr (assoc "file"
(headers request))))))))
+ (ws-stop server))))
+
(provide 'web-server-test)
- [elpa] 61/119: fix deprecated file name in file example, (continued)
- [elpa] 61/119: fix deprecated file name in file example, Eric Schulte, 2014/03/10
- [elpa] 38/119: starting on documentation, Eric Schulte, 2014/03/10
- [elpa] 60/119: quick benchmarking, Eric Schulte, 2014/03/10
- [elpa] 52/119: changed prefix: ews -> ws, Eric Schulte, 2014/03/10
- [elpa] 63/119: autoload ws-start, Eric Schulte, 2014/03/10
- [elpa] 62/119: example serving Org-mode files exported on demand, Eric Schulte, 2014/03/10
- [elpa] 64/119: fix file header, Eric Schulte, 2014/03/10
- [elpa] 65/119: handle POST file uploads w/example, Eric Schulte, 2014/03/10
- [elpa] 66/119: notes, Eric Schulte, 2014/03/10
- [elpa] 70/119: run all tests with "make check", Eric Schulte, 2014/03/10
- [elpa] 67/119: test large file upload (w/o network chunking),
Eric Schulte <=
- [elpa] 69/119: refactoring no multiple concurrent header parsing, Eric Schulte, 2014/03/10
- [elpa] 71/119: updating notes and README text, Eric Schulte, 2014/03/10
- [elpa] 72/119: notes for running behind an Apache HTTPS proxy, Eric Schulte, 2014/03/10
- [elpa] 73/119: some more examples to implement, Eric Schulte, 2014/03/10
- [elpa] 68/119: no multiple concurrent entry of ws-parse-request, Eric Schulte, 2014/03/10
- [elpa] 76/119: and more web-socket progress, Eric Schulte, 2014/03/10
- [elpa] 74/119: beginning to implement web-socket support, Eric Schulte, 2014/03/10
- [elpa] 77/119: handle chunked receipt of web-socket messages, Eric Schulte, 2014/03/10
- [elpa] 78/119: hold, Eric Schulte, 2014/03/10
- [elpa] 79/119: beginning to add convenience macro for web sockets, Eric Schulte, 2014/03/10