Skip to content

GitLab

  • Menu
Projects Groups Snippets
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
  • Sign in / Register
  • G go
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 0
    • Issues 0
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 0
    • Merge requests 0
  • Deployments
    • Deployments
    • Releases
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Commits
  • Issue Boards
Collapse sidebar
  • Kirill Smelkov
  • go
  • Repository

Switch branch/tag
  • go
  • src
  • net
  • http
  • sniff.go
Find file BlameHistoryPermalink
  • LE Manh Cuong's avatar
    net/http: fix wrong mime rar signature · 349e7df2
    LE Manh Cuong authored Mar 19, 2019
    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: default avatarBrad Fitzpatrick <bradfitz@golang.org>
    Reviewed-by: default avatarEmmanuel Odeke <emm.odeke@gmail.com>
    Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
    TryBot-Result: Gobot Gobot <gobot@golang.org>
    349e7df2

Replace sniff.go

Attach a file by drag & drop or click to upload


Cancel
GitLab will create a branch in your fork and start a merge request.
GitLab Nexedi Edition | About GitLab | About Nexedi | 沪ICP备2021021310号-2 | 沪ICP备2021021310号-7