ipfs / ipfs/kubo

MIME type sniffing bug (filename prioritized over content?)

Open
#4,543 1 comment 1 reaction 0 assignees View on GitHub
status/in-progress
Dominant language
Go
Stars
17.1k
Forks
3.2k
Avg merge
3d 18h
Merged PRs (30d)
11

Description

#### Version information:
```
go-ipfs version: 0.4.13-3b16b74
Repo version: 6
System version: amd64/linux
Golang version: go1.9.2
```
(also happens with gateway.ipfs.io)
#### Type: Bug
#### Severity: Medium

#### Description:
In short:
[For this URL ending in .png](https://ipfs.io/ipfs/QmUGzzpq3rem1wSBsKvT4GdFmH5HNozZN7tkFwYQiUmyA1/www/clonk.de/gallery.php%3Flng=en&sec=cp&img=battle.png) the http gateway wrongfully returns a `Content-Type: image/png` header.

Long story:
I was creating a little archive of [clonk.de](http://clonk.de) using `wget -k --wait=3 -e robots=off -r http://clonk.de/`.
Upon encountering the php files with search parameters, wget saved the files with a ? in the file name and converted the ? in the links to their hex escape %3F. This causes things like [gallery.php?img=battle.png](http://clonk.de/gallery.php?lng=en&sec=cp&img=battle.png) to have a file name that may make the file look like an image.

See also: https://github.com/ipfs/go-ipfs/issues/2164 and https://github.com/ipfs/notes/issues/222

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.