sohailshk commented on code in PR #77003:
URL: https://github.com/apache/airflow/pull/77003#discussion_r4604722601
##########
providers/amazon/src/airflow/providers/amazon/aws/hooks/s3.py:
##########
@@ -242,15 +242,16 @@ def parse_s3_url(s3url: str) -> tuple[str, str]:
valid_s3_virtual_hosted_format =
"https://bucket-name.s3.region-code.amazonaws.com/key-name"
format = s3url.split("//")
if re.match(r"s3[na]?:", format[0], re.IGNORECASE):
- parsed_url = urlsplit(s3url, allow_fragments=False)
- if not parsed_url.netloc:
+ # Split by hand: urlsplit would treat "?" in an S3 key as the
start of a query string.
+ # Like urlsplit, drop tabs and newlines (e.g. a trailing newline
from a templated value).
+ bucket_name, _, key = re.sub(r"[\t\r\n]", "",
s3url).partition("//")[2].partition("/")
Review Comment:
right, regression. Fixed in 663e31e , "Split S3 URLs only on the // directly
after the scheme");
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]