I think this restores the previous REST-like behavior of the landing page
authorArt Cancro <ajc@uncensored.citadel.org>
Sat, 11 Feb 2012 23:39:25 +0000 (18:39 -0500)
committerArt Cancro <ajc@uncensored.citadel.org>
Sat, 11 Feb 2012 23:39:25 +0000 (18:39 -0500)
webcit/context_loop.c
webcit/webcit.c

index e9f9401952310010b02c0f65615d4cd5fc83c4dd..dc74601e1b9ecdf4cb161275c7b046efc21ceb29 100644 (file)
@@ -336,7 +336,8 @@ int ReadHttpSubject(ParsedHttpHdrs *Hdr, StrBuf *Line, StrBuf *Buf)
        else {
                /* If this is a "flat" request for the root, display the configured landing page. */
                Hdr->HR.DontNeedAuth = 1;
-               StrBuf *NewLine = NewStrBufPlain(HKEY("GET /landing HTTP/1.0"));
+               StrBuf *NewLine = NewStrBuf();
+               StrBufAppendPrintf(NewLine, "GET /landing?go=%s HTTP/1.0", ChrPtr(Buf));
                syslog(LOG_DEBUG, "Replacing with: %s", ChrPtr(NewLine));
                int return_value = ReadHttpSubject(Hdr, NewLine, Buf);
                FreeStrBuf(&NewLine);
index 94dda267c0ea78c2106726050f2099c09a7d72e1..bb36f989817eb26c53f2d03857a0f6fa6f3034bd 100644 (file)
@@ -821,7 +821,13 @@ void display_default_landing_page(void) {
        if (WCC && WCC->serv_info && WCC->serv_info->serv_supports_guest) {
                /* default action */
 
-               if (default_landing_page) {
+               if (havebstr("go")) {
+                       syslog(9, "Explicit room selection: %s", bstr("go"));
+                       StrBuf *teh_room = NewStrBufPlain(bstr("go"), strlen(bstr("go")));
+                       smart_goto(teh_room);
+                       FreeStrBuf(&teh_room);
+               }
+               else if (default_landing_page) {
                        http_redirect(default_landing_page);
                }
                else {