roundlake/wash_out — pull request #35 by rngtng (2012-04-18 10:33:23+00:00)
Title: Don't fail when missing SOAPACTION

Another tiny but significant PR. As you know I had problems with empty SOAPACTION. Which means, the header variable was set, but an empty string. I fixed that with a rack middleware, sth like:

``` ruby
def call(env)
env["HTTP_SOAPACTION"] = "check"
@app.call(env)
end
```

this worked, but of course added to *any* request the soap action value. Better solution is to update the value only if is a empty string:

```ruby
def call(env)
if env.has_key?('HTTP_SOAPACTION') && env["HTTP_SOAPACTION"].empty?
env["HTTP_SOAPACTION"] = "check"
end
@app.call(env)
end
```

But this lead to another **problem**:
[wash_out always expects](https://github.com/rngtng/wash_out/blob/master/lib/wash_out/router.rb#L12) an action to be set. If not, `soap_action ` is `nil` which will break all following string (e.g. `force_encoding`, `gsub`etc.)

By adding a condition, we prevent processing the `nil` value and wash_out will at least end up in `_invalid_action` and return a proper SOAP error.