1
0
Fork 0
mirror of https://github.com/fog/fog.git synced 2022-11-09 13:51:43 -05:00

Improve checking for Cloud Queue message IDs.

The previous regex failed if the queue name contained a "-".
This commit is contained in:
Jeffrey C. Ollie 2014-04-05 01:55:04 -05:00
parent a19433687c
commit 5449c6a566

View file

@ -32,8 +32,8 @@ module Fog
def identity
return nil unless href
match = href.match(/(\/(\w+))*\??/)
match ? match[-1] : nil
match = href.match(/\A.*\/queues\/[a-zA-Z0-9_-]{0,64}\/messages\/(?<id>.+?)(?:\?|\z)/i)
match ? match['id'] : nil
end
alias :id :identity