* output hostname into header; in this case it would be prepended to the body
authorWilfried Göesgens <willi@citadel.org>
Sun, 23 Aug 2009 21:07:43 +0000 (21:07 +0000)
committerWilfried Göesgens <willi@citadel.org>
Sun, 23 Aug 2009 21:07:43 +0000 (21:07 +0000)
webcit/groupdav.h
webcit/groupdav_main.c
webcit/groupdav_put.c

index 49b3f49234add84d4fe3b6c13a90767b04d7d8e7..0fc7906654b2847879a509f38e81058f1d2c94bb 100644 (file)
@@ -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);
index 5df6188f2a68295fb63642537a49226246172815..c42ed8281d5432672fc94538f357099e50538a40 100644 (file)
@@ -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)
 {
index 8fdd35a8aef68467f73b7f9517f1d5428d18fa0e..8d08a1e49d184e88999b554127c115adb94dac05 100644 (file)
@@ -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));