Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@deboer-tim
Copy link
Collaborator

When there are two files with the same name but different extensions, use a different href to refer to them.

This can happen when the folder contains logo.png and logo.svg, or any other resource where there are two or more supported file extensions.

Fixes #1111.

When there are two files with the same name but different extensions, use
a different href to refer to them.

This can happen when the folder contains logo.png and logo.svg, or any
other resource where there are two or more supported file extensions.

Fixes icpctools#1111.
if (ref != null)
if (ref != null) {
// update the href if it is already in use (e.g. for logo.svg and logo.png)
int count = 2;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should increase count, but isn't #1115 better?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh, I missed the change to line 1104 and thought the draft status meant it wasn't quite done. Yeah, that works too, but I think we should pick an option that can't have conflicts and hence doesn't need the warning output, plus remove the TODO.

I had leaned toward not including the file extension in the href originally so was using the counter instead. I think it would probably be ok to just use the real filename too instead of either of these changes, just less pretty hrefs.

@vmcj
Copy link
Collaborator

vmcj commented May 23, 2025

I want to test with this so will leave mine open and we can discuss there what will be the best option.

@nickygerritsen nickygerritsen enabled auto-merge (rebase) May 23, 2025 18:17
auto-merge was automatically disabled May 23, 2025 18:21

Pull Request is not mergeable

@nickygerritsen nickygerritsen merged commit 94b5664 into icpctools:main May 23, 2025
8 checks passed
@deboer-tim deboer-tim mentioned this pull request Jul 31, 2025
@deboer-tim deboer-tim deleted the href-conflict branch August 1, 2025 14:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

CDS serving default logo with multiple mimetypes but same href

3 participants