Skip to content

Instantly share code, notes, and snippets.

@bnoordhuis
Created November 5, 2010 22:30
Show Gist options
  • Save bnoordhuis/664983 to your computer and use it in GitHub Desktop.
Save bnoordhuis/664983 to your computer and use it in GitHub Desktop.
0001-Ensure-that-non-ASCII-characters-in-the-status-line-.patch
From 1ee950ffaccdf61c102b11990a07a22038a1ec7a Mon Sep 17 00:00:00 2001
From: Ben Noordhuis <[email protected]>
Date: Fri, 5 Nov 2010 23:27:55 +0100
Subject: [PATCH] Ensure that non-ASCII characters in the status line are allowed.
---
test.c | 23 +++++++++++++++++++++++
1 files changed, 23 insertions(+), 0 deletions(-)
diff --git a/test.c b/test.c
index af9f3bb..24e2e28 100644
--- a/test.c
+++ b/test.c
@@ -833,6 +833,29 @@ const struct message responses[] =
,.body= "<xml>hello</xml>"
}
+#define NON_ASCII_IN_STATUS_LINE 10
+/* Should handle non-ASCII in status line */
+, {.name= "non-ASCII in status line"
+ ,.type= HTTP_RESPONSE
+ ,.raw= "HTTP/1.1 500 Oriëntatieprobleem\r\n"
+ "Date: Fri, 5 Nov 2010 23:07:12 GMT+2\r\n"
+ "Content-Length: 0\r\n"
+ "Connection: close\r\n"
+ "\r\n"
+ ,.should_keep_alive= FALSE
+ ,.message_complete_on_eof= FALSE
+ ,.http_major= 1
+ ,.http_minor= 1
+ ,.status_code= 500
+ ,.num_headers= 3
+ ,.headers=
+ { { "Date", "Fri, 5 Nov 2010 23:07:12 GMT+2" }
+ , { "Content-Length", "0" }
+ , { "Connection", "close" }
+ }
+ ,.body= ""
+ }
+
, {.name= NULL } /* sentinel */
};
--
1.7.0.4
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment