Skip to content

Documentation for authorized-url is wrong #42

@ai-oleynikov

Description

@ai-oleynikov

The docs say that authorized-url accepts :vhost :full

zs3/doc/index.html

Lines 2475 to 2477 in afa0ad9

prefix to the Amazon hostname. If <var>vhost</var>
is <code class='kw'>:FULL</code>, the bucket name becomes the full
hostname of the url. For example:

zs3/doc/index.html

Lines 2486 to 2487 in afa0ad9

* <b>(authorized-url :bucket "foo.example.com" :key "bar" :vhost :full)</b>
=&gt; "http://foo.example.com/bar?..."

But in reality the function just returns nil.

* (authorized-url :bucket "foo.example.com" :key "bar" :vhost :full)
=> NIL

Because in the following case macro, there is no matching clause for :full (and never was, according to git blame):

zs3/interface.lisp

Lines 940 to 969 in afa0ad9

(case vhost
(:cname
(format nil "http~@[s~*~]://~A/~@[~A~]?~@[~A&~]~A"
ssl
bucket
(url-encode key :encode-slash nil)
sub-resource
parameters))
(:amazon
(format nil "http~@[s~*~]://~A/~@[~A~]?~@[~A&~]~A"
ssl
endpoint
(url-encode key :encode-slash nil)
sub-resource
parameters))
(:wasabi
(format nil "http~@[s~*~]://~A/~@[~A~]?~@[~A&~]~A"
ssl
endpoint
(url-encode key :encode-slash nil)
sub-resource
parameters))
((nil)
(format nil "http~@[s~*~]://~A/~@[~A/~]~@[~A~]?~@[~A&~]~A"
ssl
endpoint
(url-encode bucket)
(url-encode key :encode-slash nil)
sub-resource
parameters))))))

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions