Escape slash in database name
This commit is contained in:
parent
4337e676ee
commit
190bd13723
2 changed files with 10 additions and 2 deletions
|
@ -17,7 +17,7 @@ module CouchRest
|
||||||
@name = name
|
@name = name
|
||||||
@server = server
|
@server = server
|
||||||
@host = server.uri
|
@host = server.uri
|
||||||
@uri = @root = "#{host}/#{name}"
|
@uri = @root = "#{host}/#{name.gsub('/','%2F')}"
|
||||||
@streamer = Streamer.new(self)
|
@streamer = Streamer.new(self)
|
||||||
@bulk_save_cache = []
|
@bulk_save_cache = []
|
||||||
@bulk_save_cache_limit = 500 # must be smaller than the uuid count
|
@bulk_save_cache_limit = 500 # must be smaller than the uuid count
|
||||||
|
|
|
@ -8,6 +8,14 @@ describe CouchRest::Database do
|
||||||
@db = @cr.create_db(TESTDB) rescue nil
|
@db = @cr.create_db(TESTDB) rescue nil
|
||||||
end
|
end
|
||||||
|
|
||||||
|
describe "database name including slash" do
|
||||||
|
it "should escape the name in the URI" do
|
||||||
|
db = @cr.database("foo/bar")
|
||||||
|
db.name.should == "foo/bar"
|
||||||
|
db.uri.should == "#{COUCHHOST}/foo%2Fbar"
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
describe "map query with _temp_view in Javascript" do
|
describe "map query with _temp_view in Javascript" do
|
||||||
before(:each) do
|
before(:each) do
|
||||||
@db.bulk_save([
|
@db.bulk_save([
|
||||||
|
|
Loading…
Add table
Reference in a new issue