trafficserver-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jpe...@apache.org
Subject git commit: TS-1643: Post requests with no Content-Length header sends default error response
Date Fri, 04 Jan 2013 04:46:55 GMT
Updated Branches:
  refs/heads/master 30416646c -> 4a614a967


TS-1643: Post requests with no Content-Length header sends default error response


Project: http://git-wip-us.apache.org/repos/asf/trafficserver/repo
Commit: http://git-wip-us.apache.org/repos/asf/trafficserver/commit/4a614a96
Tree: http://git-wip-us.apache.org/repos/asf/trafficserver/tree/4a614a96
Diff: http://git-wip-us.apache.org/repos/asf/trafficserver/diff/4a614a96

Branch: refs/heads/master
Commit: 4a614a967f60eaad8fa2771de7261a4da35a10df
Parents: 3041664
Author: James Peach <jpeach@apache.org>
Authored: Thu Jan 3 20:42:35 2013 -0800
Committer: James Peach <jpeach@apache.org>
Committed: Thu Jan 3 20:42:35 2013 -0800

----------------------------------------------------------------------
 CHANGES                    |    2 ++
 proxy/Prefetch.cc          |    6 ------
 proxy/http/HttpTransact.cc |    4 ++--
 3 files changed, 4 insertions(+), 8 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/trafficserver/blob/4a614a96/CHANGES
----------------------------------------------------------------------
diff --git a/CHANGES b/CHANGES
index 03bc263..3f6550e 100644
--- a/CHANGES
+++ b/CHANGES
@@ -2,6 +2,8 @@
 Changes with Apache Traffic Server 3.3.1
 
 
+  *) [TS-1643] Post requests with no Content-Length header sends default error response
+
   *) [TS-1640] SSL certificate reconfiguration only works once
 
   *) [TS-1246] trafficserver script error message (in ubuntu)

http://git-wip-us.apache.org/repos/asf/trafficserver/blob/4a614a96/proxy/Prefetch.cc
----------------------------------------------------------------------
diff --git a/proxy/Prefetch.cc b/proxy/Prefetch.cc
index 20bb84a..547898c 100644
--- a/proxy/Prefetch.cc
+++ b/proxy/Prefetch.cc
@@ -296,12 +296,6 @@ normalize_url(char *url, int *len)
 static PrefetchConfiguration *prefetch_config;
 ClassAllocator<PrefetchUrlEntry> prefetchUrlEntryAllocator("prefetchUrlEntryAllocator");
 
-#define HTTP_STATUS_MOVED_PERMANENTLY 	301
-#define HTTP_STATUS_MOVED_TEMPORARILY 	302
-#define HTTP_STATUS_SEE_OTHER         	303
-#define HTTP_STATUS_TEMPORARY_REDIRECT 	307
-
-
 #define IS_STATUS_REDIRECT(status) (prefetch_config->redirection > 0 &&\
 				       (((status) == HTTP_STATUS_MOVED_PERMANENTLY) ||\
                                         ((status) == HTTP_STATUS_MOVED_TEMPORARILY) ||\

http://git-wip-us.apache.org/repos/asf/trafficserver/blob/4a614a96/proxy/http/HttpTransact.cc
----------------------------------------------------------------------
diff --git a/proxy/http/HttpTransact.cc b/proxy/http/HttpTransact.cc
index 032cb15..38ed2e7 100644
--- a/proxy/http/HttpTransact.cc
+++ b/proxy/http/HttpTransact.cc
@@ -1100,7 +1100,7 @@ HttpTransact::handleIfRedirect(State *s)
     remap_redirect = redirect_url.string_get_ref(&remap_redirect_len);
     if (answer == TEMPORARY_REDIRECT) {
       if ((s->client_info).http_version.m_version == HTTP_VERSION(1, 1)) {
-        build_error_response(s, (HTTPStatus) 307,
+        build_error_response(s, HTTP_STATUS_TEMPORARY_REDIRECT,
                              /* which is HTTP/1.1 for HTTP_STATUS_MOVED_TEMPORARILY */
                              "Redirect", "redirect#moved_temporarily",
                              "%s <a href=\"%s\">%s</a>. %s",
@@ -6461,7 +6461,7 @@ HttpTransact::is_request_valid(State* s, HTTPHdr* incoming_request)
     {
       DebugTxn("http_trans", "[is_request_valid] post request without content length");
       SET_VIA_STRING(VIA_DETAIL_TUNNEL, VIA_DETAIL_TUNNEL_NO_FORWARD);
-      build_error_response(s, HTTP_STATUS_BAD_REQUEST, "request#no_content_length", "Content
Length Required",
+      build_error_response(s, HTTP_STATUS_BAD_REQUEST, "Content Length Required", "request#no_content_length",
                            const_cast < char *>(URL_MSG));
       return FALSE;
     }


Mime
View raw message