Vlad Gorodetsky | 7 Aug 2012 13:52
Gravatar

Riak Header Names Convention

Hi folks,

I was looking through Riak sources recently and came up with a naming question.
As far as I can see, all headers are named in a regular way:

    X-Riak-Vclock
    X-Riak-ClientId

On the other hand, prefixes are lowercase

    x-riak-meta-
    x-riak-index-

Is that the correct reason for such difference? Out of curiosity, what
is the background of this decision?

Thanks,
Vlad
Dan Reverri | 7 Aug 2012 18:01

Re: Riak Header Names Convention

Hi Vlad,


Header names are case insensitive so both forms are correct. For example:

$ curl http://127.0.0.1:8098/riak/b/k -XPUT -H 'content-type: text/plain' -H 'x-riak-meta-foo: bar' -H 'X-Riak-Meta-Baz: qux' -H 'X-RiAk-MeTa-HeLlO: world' -d 'text'

HTTP/1.1 200 OK
X-Riak-Vclock: a85hYGBgzGDKBVIcypz/fvrfdE/OYEpkzGNlYNw+9SRfFgA=
X-Riak-Meta-Hello: world
X-Riak-Meta-Foo: bar
X-Riak-Meta-Baz: qux
Vary: Accept-Encoding
Server: MochiWeb/1.1 WebMachine/1.9.0 (someone had painted it blue)
Link: </riak/b>; rel="up"
Last-Modified: Tue, 07 Aug 2012 15:57:53 GMT
ETag: "653Lp7jE6e5fa4L0ZB8cwp"
Date: Tue, 07 Aug 2012 15:58:08 GMT
Content-Type: text/plain
Content-Length: 4

text



Daniel Reverri
Client Architect
Basho Technologies, Inc.
dan <at> basho.com


On Tue, Aug 7, 2012 at 4:52 AM, Vlad Gorodetsky <v <at> gor.io> wrote:
Hi folks,

I was looking through Riak sources recently and came up with a naming question.
As far as I can see, all headers are named in a regular way:

    X-Riak-Vclock
    X-Riak-ClientId

On the other hand, prefixes are lowercase

    x-riak-meta-
    x-riak-index-

Is that the correct reason for such difference? Out of curiosity, what
is the background of this decision?

Thanks,
Vlad

_______________________________________________
riak-users mailing list
riak-users <at> lists.basho.com
http://lists.basho.com/mailman/listinfo/riak-users_lists.basho.com

_______________________________________________
riak-users mailing list
riak-users <at> lists.basho.com
http://lists.basho.com/mailman/listinfo/riak-users_lists.basho.com
Vlad Gorodetsky | 7 Aug 2012 21:52
Gravatar

Re: Riak Header Names Convention

Dan,

I understand that per spec header names are case-insensitive. I was
rather curious if there's an internal reason of this small
inconsistency in the source code.
But I guess there's no then :-) Thanks for your time!

Best,
Vlad

Gmane