Changeset 52 in code for trunk


Ignore:
Timestamp:
Nov 29, 2016, 12:30:07 PM (9 years ago)
Author:
asciimoo
Message:

Merge pull request #37 from dalf/url_fragment

[fix] URI fragment are not encoded in the mortyurl

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/morty.go

    r51 r52  
    285285        }
    286286
    287         ctx.SetContentType(fmt.Sprintf("%s; charset=UTF-8", contentInfo[0]))
     287        if bytes.Contains(contentType, []byte("xhtml")) {
     288                ctx.SetContentType("text/html; charset=UTF-8")
     289        } else {
     290                ctx.SetContentType(fmt.Sprintf("%s; charset=UTF-8", contentInfo[0]))
     291        }
    288292
    289293        switch {
Note: See TracChangeset for help on using the changeset viewer.