-
Notifications
You must be signed in to change notification settings - Fork 216
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
scripts: Handle redirects in image URLs #656
Conversation
This does not seem to work for me: Re-added
|
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.
This does not seem to be fixable by this script, we can't get the images even if we hack the url:
Working old url:
https://user-images.githubusercontent.com/3228183/211269003-613885c7-6a11-4416-b69d-6435560ec49a.png
New url:
https://github.com/cockpit-project/cockpit/assets/200109/bb33f362-a4ac-470e-a9b9-62ee5c3d3116
Modify into user-images url just fails so ugh not much we can do.
curl https://user-images.githubusercontent.com/200109/bb33f362-a4ac-470e-a9b9-62ee5c3d3116.png
<?xml version="1.0" encoding="UTF-8"?>
<Error><Code>AccessDenied</Code><Message>Access Denied</Message><RequestId>TRQ7PN4ARBTBNPFN</RequestId><HostId>x8JWBK0ueMfd6TzZK5GVAi4XiYSUGkr/mtve1V/z120GXG5ACa7z32fGDLVkL0B5PTnumegDPiY=</HostId></Error>%
429e753
to
39ed663
Compare
cdf0752
to
5d13491
Compare
5d13491
to
8c76395
Compare
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.
Would have liked to have a comment about the new urls which we need to handle now but let's get it merged. 👍
GitHub changed the way they handle images; their URLs might not have an extension now. For the time being, we should assume the images without extensions are PNG files.
We will probably want to download whatever they are and run some identification on them in the future (like the
file
command).I also switched the string extension and string concat to use native Ruby File.* commands.