Changeset 8 in code


Ignore:
Timestamp:
Oct 23, 2016, 4:27:23 PM (9 years ago)
Author:
asciimoo
Message:

[fix] support css @import statement

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/morty.go

    r7 r8  
    3232}
    3333
    34 var CSS_URL_REGEXP *regexp.Regexp = regexp.MustCompile("url\\((['\"]?)([\u0009\u0021\u0023-\u0026\u0028\u002a-\u007E]+)(['\"]?)\\)")
     34var CSS_URL_REGEXP *regexp.Regexp = regexp.MustCompile("(url\\(|@import +)(['\"]?)([\u0009\u0021\u0023-\u0026\u0028\u002a-\u007E]+)(['\"]?)\\)?")
    3535
    3636var UNSAFE_ELEMENTS [][]byte = [][]byte{
     
    224224                ctx.Write(responseBody)
    225225        }
    226 
    227226}
    228227
     
    255254
    256255        for _, s := range urlSlices {
    257                 urlStart := s[4]
    258                 urlEnd := s[5]
     256                urlStart := s[6]
     257                urlEnd := s[7]
    259258
    260259                if uri, err := proxifyURI(rc, string(css[urlStart:urlEnd])); err == nil {
Note: See TracChangeset for help on using the changeset viewer.