require 'digest/sha2'
# Sign method
def sign(m_shop, m_orderid, m_amount, m_curr, m_desc, m_key)
arHash = [
m_shop,
m_orderid,
m_amount,
m_curr,
m_desc,
m_key
]
Digest::SHA256.hexdigest(arHash.join(':')).upcase
end
# Sign
p sign('shop', 'orderid', 'amount', 'curr', 'desc', 'key')
curl localhost/images/index.html?tracker=123 --head
HTTP/1.1 200 OK
Server: nginx/1.8.0
Date: Tue, 13 Oct 2015 12:09:31 GMT
Content-Type: text/html
Content-Length: 0
Last-Modified: Tue, 13 Oct 2015 11:11:48 GMT
Connection: keep-alive
Set-Cookie: tracker=123;Max-Age=50
Accept-Ranges: bytes
location / {
root /var/site;
index index.html;
if ($arg_tracker) { add_header Set-Cookie "tracker=$arg_tracker;Max-Age=50"; }
}
location ~ \.html {
if ($arg_tracker) { add_header Set-Cookie "tracker=$arg_tracker;Max-Age=50"; }
}
А вот то что на этом роутере openwrt как коню пятая нога... :)