Changeset 18 in code for trunk


Ignore:
Timestamp:
Oct 29, 2016, 6:46:27 PM (9 years ago)
Author:
asciimoo
Message:

[fix] avoid fasthttp panic on .onion urls - see https://github.com/valyala/fasthttp/issues/196

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/morty.go

    r17 r18  
    148148        parsedURI, err := url.Parse(string(requestURI))
    149149
     150        if strings.HasSuffix(parsedURI.Host, ".onion") {
     151                p.serveMainPage(ctx, errors.New("Tor urls are not supported yet"))
     152                return
     153        }
     154
    150155        if err != nil {
    151156                p.serveMainPage(ctx, err)
Note: See TracChangeset for help on using the changeset viewer.