scripts: Handle redirects in image URLs#656
Merged
Merged
Conversation
Member
|
This does not seem to work for me: Re-added |
jelly
requested changes
Aug 9, 2023
Member
There was a problem hiding this comment.
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
Member
Author
cdf0752 to
5d13491
Compare
5d13491 to
8c76395
Compare
jelly
approved these changes
Aug 10, 2023
Member
jelly
left a comment
There was a problem hiding this comment.
Would have liked to have a comment about the new urls which we need to handle now but let's get it merged. 👍
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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
filecommand).I also switched the string extension and string concat to use native Ruby File.* commands.