From 2de0bf4c61fbe29da0952c04192739f4d347a31d Mon Sep 17 00:00:00 2001 From: =?utf8?q?Wilfried=20G=C3=B6esgens?= Date: Sun, 23 Aug 2009 21:07:43 +0000 Subject: [PATCH] * output hostname into header; in this case it would be prepended to the body --- webcit/groupdav.h | 1 + webcit/groupdav_main.c | 13 +++++++++++++ webcit/groupdav_put.c | 2 +- 3 files changed, 15 insertions(+), 1 deletion(-) diff --git a/webcit/groupdav.h b/webcit/groupdav.h index 49b3f4923..0fc790665 100644 --- a/webcit/groupdav.h +++ b/webcit/groupdav.h @@ -25,3 +25,4 @@ void groupdav_folder_list(void); void euid_escapize(char *, const char *); void euid_unescapize(char *, const char *); void groupdav_identify_host(void); +void groupdav_identify_hosthdr(void); diff --git a/webcit/groupdav_main.c b/webcit/groupdav_main.c index 5df6188f2..c42ed8281 100644 --- a/webcit/groupdav_main.c +++ b/webcit/groupdav_main.c @@ -183,6 +183,19 @@ void groupdav_identify_host(void) { } } +/* + * Output our host prefix for globally absolute URL's. + */ +void groupdav_identify_hosthdr(void) { + wcsession *WCC = WC; + + if (StrLength(WCC->Hdr->HR.http_host)!=0) { + hprintf("%s://%s", + (is_https ? "https" : "http"), + ChrPtr(WCC->Hdr->HR.http_host)); + } +} + void Header_HandleIfMatch(StrBuf *Line, ParsedHttpHdrs *hdr) { diff --git a/webcit/groupdav_put.c b/webcit/groupdav_put.c index 8fdd35a8a..8d08a1e49 100644 --- a/webcit/groupdav_put.c +++ b/webcit/groupdav_put.c @@ -197,7 +197,7 @@ void groupdav_put(void) groupdav_common_headers(); hprintf("etag: \"%ld\"\r\n", new_msgnum); hprintf("Location: "); - groupdav_identify_host(); + groupdav_identify_hosthdr(); hprintf("/groupdav/");/* TODO */ hurlescputs(ChrPtr(dav_roomname)); euid_escapize(escaped_uid, ChrPtr(dav_uid)); -- 2.39.2