Changeset 17 in code for trunk


Ignore:
Timestamp:
Oct 29, 2016, 12:26:36 AM (9 years ago)
Author:
asciimoo
Message:

[enh] do not serve javascript files

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/morty.go

    r15 r17  
    211211        }
    212212
     213        if bytes.Contains(bytes.ToLower(contentType), []byte("javascript")) {
     214                p.serveMainPage(ctx, errors.New("forbidden content type"))
     215                return
     216        }
     217
    213218        contentInfo := bytes.SplitN(contentType, []byte(";"), 2)
    214219
Note: See TracChangeset for help on using the changeset viewer.