Skip to content

Escape url slash regex #20

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

Merged
merged 2 commits into from
May 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion opencontainers/distribution/reggie/defaults.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,6 @@
__version__
)
URL_REGEX = (
"http[s]?://(?:[a-zA-Z]|[0-9]|[$-_@.&+]|[!*\(\),]|(?:%[0-9a-fA-F][0-9a-fA-F]))+"
"http[s]?:\/\/(?:[a-zA-Z]|[0-9]|[$-_@.&+]|[!*\(\),]|(?:%[0-9a-fA-F][0-9a-fA-F]))+"
)
VALID_METHODS = ["HEAD", "GET", "POST", "PATCH", "PUT", "DELETE", "OPTIONS"]
2 changes: 1 addition & 1 deletion opencontainers/tests/test_descriptor.py
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@
{
"mediaType": "application/vnd.oci.image.config.v1+json",
"size": 1470,
"digest": "sha256.foo-bar:c86f7763873b6c0aae22d963bab59b4f5debbed6685761b5951584f6efb0633b"
"digest": "sha256.foo-bar:c86f7763873b6c0aae22d963bab59b4f5debbed6685761b5951584f6efb0633b",
# multihash example removed, not supported is invalid
},
]
Expand Down
2 changes: 1 addition & 1 deletion opencontainers/tests/test_manifest.py
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@
"mediaType": "application/vnd.oci.image.layer.v1.tar+gzip",
"size": 1470,
"digest": "sha256.foo-bar:c86f7763873b6c0aae22d963bab59b4f5debbed6685761b5951584f6efb0633b",
}
},
# multihash is not registered, but still valid formatting, but here we would consider it invalid
# {
# "mediaType": "application/vnd.oci.image.config.v1+json",
Expand Down