summaryrefslogtreecommitdiff
path: root/src/cjr_print.sml
diff options
context:
space:
mode:
authorGravatar Adam Chlipala <adamc@hcoop.net>2009-06-27 17:50:31 -0400
committerGravatar Adam Chlipala <adamc@hcoop.net>2009-06-27 17:50:31 -0400
commitb9fcbe3dc86323a4a64b419c589a1cc5eeb38749 (patch)
treefb74e59d4dc2a663499f25e692fac8f08e6cb266 /src/cjr_print.sml
parente549f22abb97951897b9eaebee879addd66f2517 (diff)
.msgs processing in FastCGI
Diffstat (limited to 'src/cjr_print.sml')
-rw-r--r--src/cjr_print.sml21
1 files changed, 20 insertions, 1 deletions
diff --git a/src/cjr_print.sml b/src/cjr_print.sml
index b8db23e8..14721edd 100644
--- a/src/cjr_print.sml
+++ b/src/cjr_print.sml
@@ -2816,6 +2816,16 @@ fun p_file env (ds, ps) =
Link => false
| Action ef => ef = ReadCookieWrite
| Rpc ef => ef = ReadCookieWrite
+
+ val s =
+ case Settings.getUrlPrefix () of
+ "" => s
+ | "/" => s
+ | prefix =>
+ if size s > 0 andalso String.sub (s, 0) = #"/" then
+ prefix ^ String.extract (s, 1, NONE)
+ else
+ prefix ^ s
in
box [string "if (!strncmp(request, \"",
string (String.toString s),
@@ -3274,6 +3284,12 @@ fun p_file env (ds, ps) =
newline,
newline,
+ string "const char *uw_url_prefix = \"",
+ string (Settings.getUrlPrefix ()),
+ string "\";",
+ newline,
+ newline,
+
string "static const char begin_xhtml[] = \"<?xml version=\\\"1.0\\\" encoding=\\\"utf-8\\\" ?>\\n<!DOCTYPE html PUBLIC \\\"-//W3C//DTD XHTML 1.0 Transitional//EN\\\" \\\"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\\\">\\n<html xmlns=\\\"http://www.w3.org/1999/xhtml\\\" xml:lang=\\\"en\\\" lang=\\\"en\\\">\";",
newline,
newline,
@@ -3324,7 +3340,10 @@ fun p_file env (ds, ps) =
string "void uw_handle(uw_context ctx, char *request) {",
newline,
- string "if (!strcmp(request, \"/app.js\")) {",
+ string "if (!strcmp(request, \"",
+ string (OS.Path.joinDirFile {dir = Settings.getUrlPrefix (),
+ file = "app.js"}),
+ string "\")) {",
newline,
box [string "uw_write_header(ctx, \"Content-type: text/javascript\\r\\n\");",
newline,