Skip to content
This repository has been archived by the owner on Jul 5, 2023. It is now read-only.

Commit

Permalink
Merge branch 'release/2.3.10'
Browse files Browse the repository at this point in the history
  • Loading branch information
bobthecow committed Dec 10, 2013
2 parents a62f9e9 + 091420b commit cb83d9a
Show file tree
Hide file tree
Showing 6 changed files with 31 additions and 20 deletions.
8 changes: 8 additions & 0 deletions CHANGELOG.markdown
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
## v2.3.10

* [Fix #145][i145], [#148][i148] — work around rack-protection's misguided path decoding.

[i145]: https://github.com/bobthecow/genghis/issues/145
[i148]: https://github.com/bobthecow/genghis/issues/148


## v2.3.9

* [Fix #135][i135] — error when entering a `new Date()` value in a document.
Expand Down
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2.3.9
2.3.10
14 changes: 7 additions & 7 deletions genghis.php

Large diffs are not rendered by default.

13 changes: 8 additions & 5 deletions genghis.rb

Large diffs are not rendered by default.

11 changes: 4 additions & 7 deletions spec/requests/api_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -462,19 +462,16 @@

describe 'GET /servers/:server/databases/:db/collections/:coll' do
before :all do
# TODO: fix path chunks with encoded slashes in them
# so this test can work under rack-protect v1.5.1+
# @db.create_collection 'foo bar.baz/qux\\quux…'
@db.create_collection 'foo bar.baz:qux\\quux…'
@db.create_collection 'foo bar.baz/qux\\quux…'
end

it 'returns collection info' do
res = @api.get '/servers/localhost/databases/__genghis_spec_test__/collections/foo%20bar.baz:qux%5Cquux%E2%80%A6'
res = @api.get '/servers/localhost/databases/__genghis_spec_test__/collections/foo%20bar.baz%2Fqux%5Cquux%E2%80%A6'

res.status.should eq 200
res.body.should match_json_expression \
id: 'foo bar.baz:qux\\quux…',
name: 'foo bar.baz:qux\\quux…',
id: 'foo bar.baz/qux\\quux…',
name: 'foo bar.baz/qux\\quux…',
count: 0,
indexes: Array,
stats: Hash
Expand Down
3 changes: 3 additions & 0 deletions src/rb/genghis/server.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@ class Server < Sinatra::Base
# default to 'production' because yeah
set :environment, :production

# work around path param slash encoding issues.
set :protection, :except => :path_traversal

enable :inline_templates

helpers Sinatra::Streaming
Expand Down

0 comments on commit cb83d9a

Please sign in to comment.