Skip to content

Commit

Permalink
adding suggested changes by rohan sir
Browse files Browse the repository at this point in the history
  • Loading branch information
Devashishbasu committed Feb 8, 2024
1 parent 81fed6a commit da8eb46
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -356,10 +356,14 @@ private boolean isRegistryValidPathComponent() {

// https://github.com/distribution/reference/blob/8507c7fcf0da9f570540c958ea7b972c30eeaeca/regexp.go#L65
private static final String OPTIONAL_PORT_REGEXP = "(?::[0-9]+)?";

// https://github.com/distribution/reference/blob/8507c7fcf0da9f570540c958ea7b972c30eeaeca/regexp.go#L99
private static final String DOMAIN_NAME_REGEXP = DOMAIN_COMPONENT_REGEXP + "(?:\\." + DOMAIN_COMPONENT_REGEXP + ")*";

// https://github.com/distribution/reference/blob/8507c7fcf0da9f570540c958ea7b972c30eeaeca/regexp.go#L106
private static final String REGISTRY_HOST_REGEXP = "^(?:" + IPV6_ADDRESS_REGEXP + "|" + DOMAIN_NAME_REGEXP + ")";

// https://github.com/docker/docker/blob/04da4041757370fb6f85510c8977c5a18ddae380/vendor/github.com/docker/distribution/reference/regexp.go#L31
// https://github.com/distribution/reference/blob/8507c7fcf0da9f570540c958ea7b972c30eeaeca/regexp.go#L110
private static final Pattern REGISTRY_REGEXP = Pattern.compile(REGISTRY_HOST_REGEXP + OPTIONAL_PORT_REGEXP);

// https://github.com/docker/docker/blob/04da4041757370fb6f85510c8977c5a18ddae380/vendor/github.com/docker/distribution/reference/regexp.go#L37
Expand Down

0 comments on commit da8eb46

Please sign in to comment.