sinatra/sinatra — Issue #452: Sinatra 1.3.2 have a different value for params than 1.3.1
Author: kyzh
Created: 2012-01-11 15:00:03+00:00
State: open

This is related to the smart-proxy (http://theforeman.org/).
Considering the follwing piece of code:

```ruby
post "/dhcp/:network" do
logger.debug "Trying to create a new reservation, we got: #{params.inspect}"
begin
content_type :json
@server.addRecord(params)
rescue Proxy::DHCP::Collision => e
log_halt 409, e
rescue Proxy::DHCP::AlreadyExists
# no need to do anything
rescue => e
log_halt 400, e
end
end
```

On version 1.3.2, here is my debug output:

```ruby
Trying to create a new reservation, we got:
{"ip"=>"10.23.11.4", "filename"=>"pxelinux.0", "network"=>"10.23.11.010.23.11.0", "mac"=>"3c:d9:2b:52:8d:ff", "hostname"=>"testprovision.somewhere.bzh"}
```

Then, by downgrading to the version 1.3.1, we get correct value for the "network bit"

```ruby
Trying to create a new reservation, we got: {"hostname"=>"testprovision.somewhere.bzh", "ip"=>"10.23.11.4", "filename"=>"pxelinux.0", "mac"=>"3c:d9:2b:52:8d:ff", "network"=>"10.23.11.0"}
```

Nothing changed appart of the sinatra version.
So this is related to a third party.
I will try to come up with a test case code that doesn't involve involve foreman/smart-proxy.

I had a look for similar issue, but couldn't find one.