aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStefan Boberg <[email protected]>2021-10-03 20:11:05 +0200
committerStefan Boberg <[email protected]>2021-10-03 20:11:05 +0200
commit18186784b56fe81d2ef5e7e53398491d494f7551 (patch)
treec582ad28b0b79fbaa3401525ed6cb4c05ee08b3c
parentMerge branch 'main' of https://github.com/EpicGames/zen (diff)
downloadzen-18186784b56fe81d2ef5e7e53398491d494f7551.tar.xz
zen-18186784b56fe81d2ef5e7e53398491d494f7551.zip
http: Moved logic for body suppression to a more central location
this should prevent some mistake-induced bugs hopefully
-rw-r--r--zenhttp/httpsys.cpp5
-rw-r--r--zenserver/cache/structuredcache.cpp8
-rw-r--r--zenserver/projectstore.cpp5
3 files changed, 5 insertions, 13 deletions
diff --git a/zenhttp/httpsys.cpp b/zenhttp/httpsys.cpp
index f4d3e45fe..fedaf282e 100644
--- a/zenhttp/httpsys.cpp
+++ b/zenhttp/httpsys.cpp
@@ -1146,6 +1146,11 @@ HttpSysServerRequest::HttpSysServerRequest(HttpSysTransaction& Tx, HttpService&
{
m_AcceptType = GetAcceptType(HttpRequestPtr);
}
+
+ if (m_Verb == HttpVerb::kHead)
+ {
+ SetSuppressResponseBody();
+ }
}
Oid
diff --git a/zenserver/cache/structuredcache.cpp b/zenserver/cache/structuredcache.cpp
index 72fc7f3af..d6174caf6 100644
--- a/zenserver/cache/structuredcache.cpp
+++ b/zenserver/cache/structuredcache.cpp
@@ -272,10 +272,6 @@ HttpStructuredCacheService::HandleCacheRecordRequest(HttpServerRequest& Request,
case kHead:
case kGet:
{
- if (Verb == kHead)
- {
- Request.SetSuppressResponseBody();
- }
HandleGetCacheRecord(Request, Ref, Policy);
}
break;
@@ -692,10 +688,6 @@ HttpStructuredCacheService::HandleCachePayloadRequest(HttpServerRequest& Request
case kHead:
case kGet:
{
- if (Verb == kHead)
- {
- Request.SetSuppressResponseBody();
- }
HandleGetCachePayload(Request, Ref, Policy);
}
break;
diff --git a/zenserver/projectstore.cpp b/zenserver/projectstore.cpp
index 6b24692e1..5c4983472 100644
--- a/zenserver/projectstore.cpp
+++ b/zenserver/projectstore.cpp
@@ -1200,11 +1200,6 @@ HttpProjectService::HttpProjectService(CasStore& Store, ProjectStore* Projects)
return HttpReq.WriteResponse(HttpResponseCode::NotFound);
}
- if (Verb == HttpVerb::kHead)
- {
- HttpReq.SetSuppressResponseBody();
- }
-
if (IsOffset)
{
if (Offset > Value.Size())