Permalink
Browse files

Merge pull request #339 from jetsonsystems/master

Fixes to JSON body parsing in built in router, and dialogClose not properly cleaning on on open/save dialog.
  • Loading branch information...
2 parents 839dd3d + c98de1e commit 641fb5bd1e8a548391c220ea81f7bb20d821b86f @milani milani committed Apr 3, 2013
Showing with 7 additions and 6 deletions.
  1. +1 −1 binding.gyp
  2. +3 −3 lib/router/bodyParser.js
  3. +3 −2 src/native_window/native_window_mac.mm
View
@@ -286,7 +286,7 @@
'link_settings': {
'libraries': [
'<(module_root_dir)/deps/cef/Release/lib.target/libcef.dylib',
- '<(module_root_dir)/build/Release/cef_dll_wrapper.a',
+ '<(module_root_dir)/build/Release/cef_dll_wrapper.node',
'-lobjc'
]
}
View
@@ -22,7 +22,7 @@ var qs = require('querystring');
*/
function mime(req) {
- var str = req.headers['Content-Type'] || '';
+ var str = req.headers['content-type'] || '';
return str.split(';')[0];
}
@@ -62,7 +62,7 @@ exports.parsers['application/x-www-form-urlencoded'] = function(req){
* Parse application/json.
*/
-exports.parse['application/json'] = function(req){
+exports.parsers['application/json'] = function(req){
try {
req.post = req.body = req.post.length
? JSON.parse(req.post)
@@ -79,7 +79,7 @@ exports.parse['application/json'] = function(req){
* that CEF pre-parse files and extract them from post data?
*/
-exports.parse['multipart/form-data'] = function(req){
+exports.parsers['multipart/form-data'] = function(req){
try {
req.post = req.body = req.post.length
? qs.parse(req.post)
@@ -399,6 +399,7 @@ void AddWebView(CefWindowHandle parent, char* url, Settings* settings) {
settings->result = [dialog URLs];
ProcessFileDialog(req);
}
+ [dialog release];
}];
} else {
@@ -418,8 +419,8 @@ void AddWebView(CefWindowHandle parent, char* url, Settings* settings) {
settings->result = [NSArray arrayWithObject: [dialog URL]];
ProcessFileDialog(req);
}
+ [dialog release];
}];
-
}
[lock unlock];
@@ -450,9 +451,9 @@ void AddWebView(CefWindowHandle parent, char* url, Settings* settings) {
cb->Call( settings->me->GetV8Handle(), argc, argv );
}
+ NativeWindow::DialogClosed();
}
-
void NativeWindow::OpenColorDialog(uv_work_t* req) {
}

0 comments on commit 641fb5b

Please sign in to comment.