New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix path with contained query #3321
Fix path with contained query #3321
Conversation
Query can be a hash also, actually, and I think in this case it might be clearer to do so. I'll include examples inline for clarity. What do you think? Thanks! |
if attribute | ||
path = "images/detail?#{attribute}=#{URI::encode(query)}" | ||
query = "#{attribute}=#{URI::encode(query)}" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So this might be { attribute => URI::encode(query) }
.
I misunderstood on first read through. I'll test the hash syntax, seems nicer. |
Query inside path is not allowed, it should be under separate key :query. Putting query inside path leads to error: URI::InvalidComponentError Exception: bad component(expected absolute path component): /v1.1/images/detail?limit=20 Caused most probably by this comparison: URI::parser.regexp[:ABS_PATH] !~ v
c89c909
to
cc04c7f
Compare
Cool, seems like the hash syntax works. Thanks for pointing that out. |
Looks good, thanks! |
…etailed Fix path with contained query
Pagination is always forced by Glance conf file. So we need to always obtain all pages of images in cycle. Depends-On: fog/fog#3321 Depends-On: fog/fog#3322 https://bugzilla.redhat.com/show_bug.cgi?id=1164764
Query inside path is not allowed, it should be under
separate key :query.
Putting query inside path leads to error:
URI::InvalidComponentError Exception: bad
component(expected absolute path component):
/v1.1/images/detail?limit=20
Caused most probably by this comparison:
URI::parser.regexp[:ABS_PATH] !~ v