Skip to content

Add functionality to make a url signed for a HEAD request to S4 driver - #63

Merged
stevvooe merged 1 commit into
distribution:masterfrom
AndreyKostov:add-urlfor-method-param
Jan 15, 2015
Merged

stevvooe merged 1 commit into
distribution:masterfrom
AndreyKostov:add-urlfor-method-param

Conversation

@AndreyKostov

Copy link
Copy Markdown
Contributor

Comment thread storagedriver/s3/s3.go Outdated

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This will panic if the method is not a string. It should be something like this:

m, ok  = method.(string)
if !ok || (m != "GET" && m != "HEAD") {
    return "", storagedriver.ErrUnsupportedMethod
}
methodString = m

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It will not, because you will never reach the line if method is not either the string "GET" or the string "HEAD"

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Exactly. That statement continuing to not crash relies on a side-effect of the if statement above. If this condition gets changed in any way such that the guarantee is removed, it will crash, unexpectedly.

@AndreyKostov
AndreyKostov force-pushed the add-urlfor-method-param branch from a389bf2 to bdd5d35 Compare January 14, 2015 21:37
@stevvooe

Copy link
Copy Markdown
Collaborator

Waiting on LGTM from @BrianBland.

@BrianBland

Copy link
Copy Markdown
Contributor

LGTM, I'll submit a PR in a moment with the remaining changes to LayerHandler

@BrianBland

Copy link
Copy Markdown
Contributor

Verified to work for both v2 and v4 auth.

@stevvooe stevvooe added this to the Registry/Beta milestone Jan 15, 2015
stevvooe added a commit that referenced this pull request Jan 15, 2015
Add functionality to make a url signed for a HEAD request to S4 driver
@stevvooe
stevvooe merged commit effa09b into distribution:master Jan 15, 2015
@stevvooe stevvooe mentioned this pull request Mar 5, 2015
4 tasks
@stevvooe stevvooe modified the milestones: Registry/2.0.0-beta, Registry/2.0 Mar 31, 2015
jbpratt pushed a commit to jbpratt/openshift-docker-distribution that referenced this pull request Sep 2, 2026
CORS-4520: GCP: Add Universe Domain Support
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants