Index: src/th_main.c ================================================================== --- src/th_main.c +++ src/th_main.c @@ -1366,10 +1366,29 @@ }else{ Th_SetResult(interp, "repository unavailable", -1); return TH_ERROR; } } + +/* +** TH1 command: cgiHeaderLine line +** +** Adds the specified line to the CGI header. +*/ +static int cgiHeaderLineCmd( + Th_Interp *interp, + void *p, + int argc, + const char **argv, + int *argl +){ + if( argc!=2 ){ + return Th_WrongNumArgs(interp, "cgiHeaderLine line"); + } + cgi_append_header(argv[1]); + return TH_OK; +} /* ** TH1 command: unversioned content FILENAME ** ** Attempts to locate the specified unversioned file and return its contents. @@ -1982,10 +2001,11 @@ void *pContext; } aCommand[] = { {"anoncap", hascapCmd, (void*)&anonFlag}, {"anycap", anycapCmd, 0}, {"artifact", artifactCmd, 0}, + {"cgiHeaderLine", cgiHeaderLineCmd, 0}, {"checkout", checkoutCmd, 0}, {"combobox", comboboxCmd, 0}, {"date", dateCmd, 0}, {"decorate", wikiCmd, (void*)&aFlags[2]}, {"dir", dirCmd, 0}, Index: test/th1.test ================================================================== --- test/th1.test +++ test/th1.test @@ -1029,14 +1029,14 @@ # fossil test-th-eval "info commands" set sorted_result [lsort $RESULT] protOut "Sorted: $sorted_result" set base_commands {anoncap anycap array artifact break breakpoint catch\ - checkout combobox continue date decorate dir enable_output encode64\ - error expr for getParameter glob_match globalState hascap hasfeature\ - html htmlize http httpize if info insertCsrf lindex linecount list\ - llength lsearch markdown proc puts query randhex redirect regexp\ + cgiHeaderLine checkout combobox continue date decorate dir enable_output \ + encode64 error expr for getParameter glob_match globalState hascap \ + hasfeature html htmlize http httpize if info insertCsrf lindex linecount \ + list llength lsearch markdown proc puts query randhex redirect regexp\ reinitialize rename render repository return searchable set\ setParameter setting stime string styleFooter styleHeader styleScript\ tclReady trace unset unversioned uplevel upvar utime verifyCsrf wiki} set tcl_commands {tclEval tclExpr tclInvoke tclIsSafe tclMakeSafe} if {$th1Tcl} { Index: www/th1.md ================================================================== --- www/th1.md +++ www/th1.md @@ -167,10 +167,11 @@ features of Fossil. The following is a summary of the extended commands: * anoncap * anycap * artifact + * cgiHeaderLine * checkout * combobox * date * decorate * dir @@ -246,10 +247,17 @@ * artifact ID ?FILENAME? Attempts to locate the specified artifact and return its contents. An error is generated if the repository is not open or the artifact cannot be found. + +TH1 cgiHeader Command +------------------------------------------------- + + * cgiHeaderLine line + +Adds the specified line to the CGI header. TH1 checkout Command ------------------------------------------- * checkout ?BOOLEAN?