Skip to content

Instantly share code, notes, and snippets.

@Bogdanp
Created January 13, 2020 09:06
Show Gist options
  • Save Bogdanp/223ff84f459265836c0d70707f9a5f59 to your computer and use it in GitHub Desktop.
Save Bogdanp/223ff84f459265836c0d70707f9a5f59 to your computer and use it in GitHub Desktop.
From 391facbb5616c4a712b42fd6e60b1852c8f39c45 Mon Sep 17 00:00:00 2001
From: Bogdan Popa <[email protected]>
Date: Mon, 13 Jan 2020 11:05:11 +0200
Subject: [PATCH] tests: update e2e tests to use safety-limits
---
.../tests/web-server/e2e/file-upload/server.rkt | 8 +++++---
web-server-test/tests/web-server/e2e/json/server.rkt | 4 +++-
.../tests/web-server/e2e/read-write/server.rkt | 6 ++++--
3 files changed, 12 insertions(+), 6 deletions(-)
diff --git a/web-server-test/tests/web-server/e2e/file-upload/server.rkt b/web-server-test/tests/web-server/e2e/file-upload/server.rkt
index 2c7dc22..0e9409d 100644
--- a/web-server-test/tests/web-server/e2e/file-upload/server.rkt
+++ b/web-server-test/tests/web-server/e2e/file-upload/server.rkt
@@ -2,6 +2,7 @@
(require openssl/sha1
racket/port
+ web-server/safety-limits
web-server/servlet
web-server/servlet-dispatch
web-server/web-server)
@@ -25,6 +26,7 @@
(serve
#:port port
#:dispatch (dispatch/servlet file-upload)
- #:max-request-files 2
- #:max-request-file-length 500
- #:max-request-file-memory-threshold 250)))
+ #:safety-limits (make-safety-limits
+ #:max-form-data-files 2
+ #:max-form-data-file-length 500
+ #:form-data-file-memory-threshold 250))))
diff --git a/web-server-test/tests/web-server/e2e/json/server.rkt b/web-server-test/tests/web-server/e2e/json/server.rkt
index 92fe935..41ddef5 100644
--- a/web-server-test/tests/web-server/e2e/json/server.rkt
+++ b/web-server-test/tests/web-server/e2e/json/server.rkt
@@ -2,6 +2,7 @@
(require json
racket/port
+ web-server/safety-limits
web-server/servlet
web-server/servlet-dispatch
web-server/web-server)
@@ -56,4 +57,5 @@
(serve
#:port port
#:dispatch (dispatch/servlet go)
- #:max-request-body-length 255)))
+ #:safety-limits (make-safety-limits
+ #:max-request-body-length 255))))
diff --git a/web-server-test/tests/web-server/e2e/read-write/server.rkt b/web-server-test/tests/web-server/e2e/read-write/server.rkt
index 921713a..83faa2f 100644
--- a/web-server-test/tests/web-server/e2e/read-write/server.rkt
+++ b/web-server-test/tests/web-server/e2e/read-write/server.rkt
@@ -1,6 +1,7 @@
#lang racket/base
(require racket/port
+ web-server/safety-limits
web-server/servlet
web-server/servlet-dispatch
web-server/web-server)
@@ -17,5 +18,6 @@
(serve
#:port port
#:dispatch (dispatch/servlet read-write)
- #:request-read-timeout 1
- #:response-send-timeout 1)))
+ #:safety-limits (make-safety-limits
+ #:request-read-timeout 1
+ #:response-send-timeout 1))))
--
2.24.1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment