Skip to content
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

Gateway shows file icon for directory called protocol.ai instead of directory icon #4617

Open
victorb opened this issue Jan 27, 2018 · 5 comments
Labels
kind/bug A bug in existing code (including security flaws) topic/gateway Topic gateway

Comments

@victorb
Copy link
Member

victorb commented Jan 27, 2018

Version information:

go-ipfs version: 0.4.12-
Repo version: 6
System version: amd64/linux
Golang version: go1.9.2

Type:

Bug

Severity:

Low

Description:

When adding a directory that has a link protocol.ai, the gateway shows this directory as a Adobe Illustrator file (I think) rather than a directory.

Steps to reproduce:

$ mkdir test
$ mkdir test/protocol.ai
$ mkdir test/libp2p.io
$ echo "protocol.ai" > test/protocol.ai/index.html
$ echo "libp2p.io" > test/libp2p.io/index.html
$ ipfs add -rQ test
QmQ9C4WiXrPE2NUW8GM3GwXdZudvxzJynMM7XwzBxi3CeX

Looking at the gateway on the test directory (https://ipfs.io/ipfs/QmQ9C4WiXrPE2NUW8GM3GwXdZudvxzJynMM7XwzBxi3CeX) you'll see the following:

image

Notice the protocol.ai link shows some file extension icon instead of the directory icon.

Edit: it still works as a directory though, as you can navigate to https://ipfs.io/ipfs/QmQ9C4WiXrPE2NUW8GM3GwXdZudvxzJynMM7XwzBxi3CeX/protocol.ai/ and see the right output. But the icon for the directory is wrong.

@victorb victorb added kind/bug A bug in existing code (including security flaws) topic/gateway Topic gateway labels Jan 27, 2018
@victorb victorb changed the title Gateway believe directory called protocol.ai is a file rather than directory Gateway shows file icon for directory called protocol.ai instead of directory icon Jan 27, 2018
@victorb
Copy link
Member Author

victorb commented Jan 27, 2018

Updated title to be more clear as it still works as a directory, but just the icon is wrong.

@djdv
Copy link
Contributor

djdv commented Jan 27, 2018

#4545 #4543 probably relevant

@djdv
Copy link
Contributor

djdv commented Feb 2, 2018

I don't know if this should be a separate issue but I noticed the gateway doesn't seem to like uppercase extensions either.
icons case

@jbenet
Copy link
Member

jbenet commented Feb 25, 2019

I noticed this just now-- See: http://talks.benet.ai/2018-07-08-ipfs-dev-meetings -- these are all directories

@Stebalien
Copy link
Member

So, the issue is that the directory doesn't store any information about file types (except file names). ls works around this by fetching the root block of every directory entry but that's could cause some performance issues on the gateway.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug A bug in existing code (including security flaws) topic/gateway Topic gateway
Projects
None yet
Development

No branches or pull requests

4 participants