summaryrefslogtreecommitdiff
path: root/db/dbwebserver.cpp
diff options
context:
space:
mode:
authorMathias Stearn <mathias@10gen.com>2010-08-25 15:25:54 -0400
committerMathias Stearn <mathias@10gen.com>2010-08-25 15:26:20 -0400
commit259dc007d7a97410fd7ccc85d1ef70f4f806024d (patch)
treec6ce43c9d3510c4ae32e24ae3cd751d4d82610c8 /db/dbwebserver.cpp
parent6c71ce88ffe42e1c44d175a2cb3705632c81f7e6 (diff)
downloadmongo-259dc007d7a97410fd7ccc85d1ef70f4f806024d.tar.gz
Disable JSONP by default due to security implications
Diffstat (limited to 'db/dbwebserver.cpp')
-rw-r--r--db/dbwebserver.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/db/dbwebserver.cpp b/db/dbwebserver.cpp
index 4051b7d83c5..8534d52c75c 100644
--- a/db/dbwebserver.cpp
+++ b/db/dbwebserver.cpp
@@ -168,9 +168,11 @@ namespace mongo {
if ( handler->requiresREST( url ) && ! cmdLine.rest ){
_rejectREST( responseMsg , responseCode , headers );
}else{
+ string callback = params.getStringField("jsonp");
+ uassert(13453, "server not started with --jsonp", callback.empty() || cmdLine.jsonp);
+
handler->handle( rq , url , params , responseMsg , responseCode , headers , from );
- string callback = params.getStringField("jsonp");
if (responseCode == 200 && !callback.empty()){
responseMsg = callback + '(' + responseMsg + ')';
}