Skip to content

Commit

Permalink
tweak examples and doc
Browse files Browse the repository at this point in the history
  • Loading branch information
dropwhile committed Aug 23, 2023
1 parent 618f375 commit f0fd02f
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 4 deletions.
15 changes: 12 additions & 3 deletions README.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -408,10 +408,19 @@ by default, you could add this to the command line:
When this option is supplied, extra headers may be included with the url payload as part of url generation.
These extra headers will then be returned as part of the response.

These extra headers are part of a 4th encoded url path component, signed under the hmac signature.
These extra headers are part of an additional encoded url path component, signed under the hmac signature.

The underlying data is a json dict/map of string values. +
Example:
Example standard url format:
----
/D23vHLFHsOhPOcvdxeoQyAJTpvM/aHR0cDovL2dvbGFuZy5vcmcvZG9jL2dvcGhlci9mcm9udHBhZ2UucG5n
----

Example of extra-headers component url format:
----
/sYpOByX0byESnG24QMUX5Ac0IXM/aHR0cDovL2dvbGFuZy5vcmcvZG9jL2dvcGhlci9mcm9udHBhZ2UucG5n/eyJjb250ZW50LWRpc3Bvc2l0aW9uIjoiYXR0YWNobWVudDsgZmlsZW5hbWU9XCJpbWFnZS5wbmdcIiJ9
----

The underlying extra-headers data in the above url path partial is a json dict/map of string values:
----
{
"content-disposition": "attachment; filename=\"image.png\""
Expand Down
2 changes: 1 addition & 1 deletion examples/python3-base64.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ def camo_url(hmac_key, image_url, extra_headers=None):
camo_url(
"test",
"http://golang.org/doc/gopher/frontpage.png",
{"content-disposition": "attachment; filename=\"image.png\""}
{"content-disposition": 'attachment; filename="image.png"'}
)
)
# https://img.example.com/-hNoquWgyjNgzF7HXYyvGwteyLI/aHR0cDovL2dvbGFuZy5vcmcvZG9jL2dvcGhlci9mcm9udHBhZ2UucG5n/eyJjb250ZW50LWRpc3Bvc2l0aW9uIjogImF0dGFjaG1lbnQ7IGZpbGVuYW1lPVwiaW1hZ2UucG5nXCIifQ
Expand Down

0 comments on commit f0fd02f

Please sign in to comment.