public
Description: A cross-platform web server that's scripted with Nu.
Homepage: http://programming.nu
Clone URL: git://github.com/timburks/nunja.git
Improved formatting. Pages are now correctly wrapped in <html> tags.
timburks (author)
Fri May 09 18:18:44 -0700 2008
commit  6925778de78b071d59f91ca75be5582a6eb1e5a6
tree    274270fae7c402d7885b0a99c211e4bda11e8861
parent  ce659aa8fae6d50c53f4490f616a8c9603dd530e
...
164
165
166
167
 
168
169
170
171
172
173
174
 
 
 
175
176
177
...
164
165
166
 
167
168
169
170
171
 
 
 
172
173
174
175
176
177
0
@@ -164,14 +164,14 @@
0
         (unless BODY (return)) ;; return early and leave connection open, this expects the handler to have created a closure
0
         
0
         (if (BODY isKindOfClass:NSString)
0
- (then (set html "<head>\n")
0
+ (then (set html "<html>\n<head>\n")
0
                   (if (response "HEAD")
0
                       (then (html appendString:(response "HEAD")))
0
                       (else (if HEAD (html appendString:HEAD))))
0
                   (if (response "TITLE")
0
- (then (html appendString:(+ "<title>" (response "TITLE") "</title>")))
0
- (else (if TITLE (html appendString:(+ "<title>" TITLE "</title>")))))
0
- (html appendString: (+ "</head>\n<body>\n" BODY "</body>\n"))
0
+ (then (html appendString:(+ "\n<title>" (response "TITLE") "</title>")))
0
+ (else (if TITLE (html appendString:(+ "\n<title>" TITLE "</title>")))))
0
+ (html appendString: (+ "</head>\n<body>\n" BODY "\n</body>\n</html>\n"))
0
                   (request respondWithString:html))
0
             (else (request respondWithData:BODY))))
0
      

Comments

    No one has commented yet.