]> Cypherpunks repositories - gostls13.git/commit
net/http: fix wrong mime rar signature
authorLE Manh Cuong <cuong.manhle.vn@gmail.com>
Tue, 19 Mar 2019 09:16:50 +0000 (16:16 +0700)
committerEmmanuel Odeke <emm.odeke@gmail.com>
Tue, 19 Mar 2019 15:54:05 +0000 (15:54 +0000)
commit349e7df2c3d0f9b5429e7c86121499c137faac7e
tree3a883ec63371d0009debe1444de6bfe624c19d55
parentb4f3b8a313a81105d923d2b7ed0b8b7524084b63
net/http: fix wrong mime rar signature

MIME sniffing standard defines the RAR signature as 52 61 72 20 1A 07 00.

But this signature is wrong, the RARlab spec defines the 4th byte must
be 0x21 or "!", not 0x20 or " ". Checking a rar file also indicates that:

$ file abc.rar
abc.rar: RAR archive data, v1d, os: Win32
$ head -c 7 abc.rar | od -v -t x1
0000000 52 61 72 21 1a 07 00
0000007

There is also an issue to fix this problem in MIME standard.

See:
 - https://www.rarlab.com/technote.htm#rarsign
 - https://github.com/whatwg/mimesniff/issues/63

Fixes #30926

Change-Id: Id2e2de7ecbf7f44d37ebaf280efd05e4972c5078
Reviewed-on: https://go-review.googlesource.com/c/go/+/167781
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Reviewed-by: Emmanuel Odeke <emm.odeke@gmail.com>
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
src/net/http/sniff.go
src/net/http/sniff_test.go