sensu / sensu-dashboard

A dashboard for Sensu, for displaying & managing events & clients.
http://sensuapp.org
MIT License
96 stars 44 forks source link

Fix basic auth realm syntax #158

Closed philandstuff closed 10 years ago

philandstuff commented 10 years ago

A basic auth realm parameter is a quoted-string RFC2617§1.2; a quoted-string takes double quotes, not single quotes RFC2616§2.2.

portertech commented 10 years ago

The use of single vs. double quotes in a Ruby array actually translates to a different header?

@philandstuff by chance do you have a snippet or screenshot of the effect?

philandstuff commented 10 years ago

The %(...) construct is a quoting operator; those single and double quotes are part of the resultant string:

irb(main):001:0> %(Basic realm='Restricted Area')
=> "Basic realm='Restricted Area'"
irb(main):002:0> %(Basic realm="Restricted Area")
=> "Basic realm=\"Restricted Area\""

The effect is that you get you must log in to area "'Restricted" on <server> when going to a sensu-dashboard instance in safari -- note the leading single quote before Restricted.

Yes, it's quite a minor bug :smile:

portertech commented 10 years ago

:+1: