public
Description: A cross-platform web server that's scripted with Nu.
Homepage: http://programming.nu
Clone URL: git://github.com/timburks/nunja.git
Fixed broken post example and pseudo-downloader.

These two actions in the sample site were broken by recent changes.
timburks (author)
Tue Apr 29 21:26:55 -0700 2008
commit  d5c9b6b4bc2090aef92acbde637be89b13db5357
tree    f5bd8af3c4ef3567c865eaee81224f34aae0156e
parent  ed36a984b5545f3f00262c56f31f446f7ffb297e
...
134
135
136
137
138
139
140
 
 
 
 
141
142
143
...
146
147
148
149
150
151
 
 
 
152
153
154
...
134
135
136
 
 
 
 
137
138
139
140
141
142
143
...
146
147
148
 
 
 
149
150
151
152
153
154
0
@@ -134,10 +134,10 @@ END)
0
 
0
 ;; image uploads
0
 (post "/postimage"
0
- (puts (request description))
0
- (set postBody (request body))
0
- (puts ((request requestHeaders) description))
0
- (set contentType ((request requestHeaders) "Content-Type"))
0
+ (puts (REQUEST description))
0
+ (set postBody (REQUEST body))
0
+ (puts ((REQUEST requestHeaders) description))
0
+ (set contentType ((REQUEST requestHeaders) "Content-Type"))
0
       (set boundary ((contentType componentsSeparatedByString:"=") lastObject))
0
       (set postDictionary (postBody multipartDictionaryWithBoundary:boundary))
0
       (set image (postDictionary objectForKey:"image"))
0
@@ -146,9 +146,9 @@ END)
0
       "thanks for uploading!")
0
 
0
 ;; large file download
0
-(get /\/data(.*)/
0
- (request setValue:"application/octet-stream" forResponseHeader:"Content-Type")
0
- (set size (@match groupAtIndex:1))
0
+(get (regex -"/data(.*)")
0
+ (REQUEST setValue:"application/octet-stream" forResponseHeader:"Content-Type")
0
+ (set size (MATCH groupAtIndex:1))
0
      (set megabytes (if (eq size "")
0
                         then 1
0
                         else (size doubleValue)))

Comments

    No one has commented yet.