zipmark/rspec_api_documentation — pull request #110 by jandillmann (2014-01-21 16:44:00+00:00)
Title: Fix HTTP basic authentication header detection for cURL example

Unfortunately there is a bug in my previous pull request #108.

Headers in specs are written with a `HTTP_` prefix (e.g. `HTTP_AUTHORIZATION`), and given without alteration to the `Curl` class ([source](https://github.com/zipmark/rspec_api_documentation/blob/master/spec/curl_spec.rb#L4)).

When generating the API documentation, headers for `Curl` are set by `ClientBase` ([source](https://github.com/zipmark/rspec_api_documentation/blob/master/lib/rspec_api_documentation/client_base.rb#L63)), which includes `Headers` which formats them nicely (e.g. "Authorization") ([source](https://github.com/zipmark/rspec_api_documentation/blob/master/lib/rspec_api_documentation/headers.rb#L10)).

Therefore the spec is green, but in production the generated documentation does not show the username and password as desired. This pull request uses a regular expression to detect the authorization header, either written as `HTTP_AUTHORIZATION` or `Authorization`.