Commits

Benoit Chesneau committed a992684

encode dbname. spotted by LordMetroid on irc.

  • Participants
  • Parent commits e0768d2

Comments (0)

Files changed (1)

File src/couchbeam_server.erl

 %% @doc delete a database with dbname    
 delete_db(ConnectionId, DbName) ->
     Pid = server_pid(ConnectionId),
-    gen_server:call(Pid, {delete_db, DbName}, infinity).
+    gen_server:call(Pid, {delete_db, couchbeam_util:url_encode(DbName)}, infinity).
         
 open_or_create_db(ConnectionId, DbName) ->
     open_or_create_db(ConnectionId, DbName, true).
 
 alias_db(DbName, ServerName) ->
     case DbName of
-        {Alias1, Name1} -> {Alias1, Name1};
+        {Alias1, Name1} -> {Alias1, couchbeam_util:url_encode(Name1)};
         Name1 ->
             Alias1 = {ServerName, Name1},
-            {Alias1, Name1}
+            {Alias1, couchbeam_util:url_encode(Name1)}
     end.