[Pkg-javascript-commits] [node-stream-http] 48/208: Disable cache for testing server

Bastien Roucariès rouca at moszumanska.debian.org
Sun Aug 13 13:39:26 UTC 2017


This is an automated email from the git hooks/post-receive script.

rouca pushed a commit to branch master
in repository node-stream-http.

commit fa5eb897ada2e80c364d5b52503e935e293d13f5
Author: John Hiesey <john at hiesey.com>
Date:   Sun Jul 12 18:20:38 2015 -0700

    Disable cache for testing server
---
 test/server/index.js | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/test/server/index.js b/test/server/index.js
index d02fc84..3b5a709 100644
--- a/test/server/index.js
+++ b/test/server/index.js
@@ -15,6 +15,13 @@ var copiesMimeTypes = {
 
 var maxDelay = 5000 // ms
 
+// This should make sure bodies aren't cached
+// so the streaming tests always pass
+app.use(function (req, res, next) {
+	res.setHeader('Cache-Control', 'no-store')
+	next()
+})
+
 app.get('/testHeaders', function (req, res) {
 	var parsed = url.parse(req.url, true)
 
@@ -62,6 +69,7 @@ app.use(function (req, res, next) {
 	var parsed = url.parse(req.url, true)
 
 	if ('copies' in parsed.query) {
+		console.log('new request:', parsed.path)
 		var totalCopies = parseInt(parsed.query.copies, 10)
 		function fail () {
 			res.statusCode = 500
@@ -82,6 +90,8 @@ app.use(function (req, res, next) {
 				if (copies === 0) 
 					return res.end()
 
+				if (parsed.path.indexOf('browserify.png') >= 0)
+					console.log('writing', data.length, 'bytes')
 				res.write(data, function (err) {
 					if (err)
 						return fail()

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-javascript/node-stream-http.git



More information about the Pkg-javascript-commits mailing list