Changeset 32 in code for trunk/morty.go


Ignore:
Timestamp:
Nov 24, 2016, 7:46:31 PM (9 years ago)
Author:
asciimoo
Message:

Merge pull request #30 from dalf/html

[mod] static HTML

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/morty.go

    r31 r32  
    492492        if bytes.Equal(http_equiv, []byte("refresh")) && urlIndex != -1 {
    493493                contentUrl := content[urlIndex+4:]
     494                // special case of <meta http-equiv="refresh" content="0; url='example.com/url.with.quote.outside'">
     495                if len(contentUrl)>=2 && (contentUrl[0] == byte('\'') || contentUrl[0] == byte('"')) {
     496                        if contentUrl[0] == contentUrl[len(contentUrl)-1] {
     497                                contentUrl=contentUrl[1:len(contentUrl)-1]
     498                        }
     499                }
     500                // output proxify result
    494501                if uri, err := rc.ProxifyURI(string(contentUrl)); err == nil {
    495502                        fmt.Fprintf(out, ` http-equiv="refresh" content="%surl=%s"`, content[:urlIndex], uri)
Note: See TracChangeset for help on using the changeset viewer.