Changeset 50 in code


Ignore:
Timestamp:
Nov 29, 2016, 10:12:48 AM (9 years ago)
Author:
asciimoo
Message:

[fix] use html content-type on xhtml responses - closes #17

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/morty.go

    r47 r50  
    125125        []byte("date"),
    126126        []byte("last-modified"),
    127         []byte("refresh"), // URL rewrite 
     127        []byte("refresh"), // URL rewrite
    128128        // []byte("location"), TODO URL rewrite
    129129        []byte("content-language"),
     
    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.