nicolasff / webdis

A Redis HTTP interface with JSON output
https://webd.is
BSD 2-Clause "Simplified" License
2.83k stars 304 forks source link

truncates the key to the last dot. #25

Closed raszi closed 13 years ago

raszi commented 13 years ago

I have dots in my keys, and webdis cuts the key from the last dot. I can workaround the request by appending something after my key, but it's annoying a little.

raszi commented 13 years ago

okay, I've found out it's the formatting, which should fall back to the default json if an invalid has been provided.

What do you think?

bmatheny commented 13 years ago

Seems like it would be easy to make configurable but yeah JSON makes sense to me.

nicolasff commented 13 years ago

Hi István,

Sorry for this late reply, I still don't have an Internet connection at home so can't really work on webdis yet; I hope to get it sometime this week. I agree with your suggestion, but note that any supported extension will be handled with a specific content/type.

Nicolas

raszi commented 13 years ago

My suggestion is don't cut the last part of the key if the format is not known as an extension.

So, the following key: foo.bar should be forwarded to redis as it is: foo.bar, but foo.bar.json should be forwarded as the same foo.bar, and foo.bar.raw as well, etc.

Or even better to simply send a 400 invalid request to the client if the extension is not known.

nicolasff commented 13 years ago

Right, that's what I did. I'll push it as soon as possible, hopefully tonight.

nicolasff commented 13 years ago

This is now fixed.

raszi commented 13 years ago

Wonderful, thank you!