This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Get ID from user etag, if | |
def get_current_etag | |
etag = request.env['HTTP_IF_NONE_MATCH'] | |
if etag.blank? | |
new_etag = create_etag_hash | |
return new_etag.to_json | |
else | |
return etag | |
end | |
end | |
def create_etag_hash | |
etag = Hash.new | |
etag["__client_id"] = UUIDTools::UUID.random_create.to_s | |
etag["__profile_id"] = '' | |
return etag | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment