diff options
author | =Corey Hulen <corey@hulen.com> | 2015-07-22 18:05:44 -0800 |
---|---|---|
committer | =Corey Hulen <corey@hulen.com> | 2015-07-22 18:05:44 -0800 |
commit | c277a98b5d88c81df39f8e33ef1286f72ac04014 (patch) | |
tree | 0d96238a2ee3ab121ea576db9900311ff5a57ba6 /model | |
parent | e0bad6c03784d44210760577550be585daf513b9 (diff) | |
parent | f4c3eaa8c091366a956fa2ab48124190f4f9082b (diff) | |
download | chat-c277a98b5d88c81df39f8e33ef1286f72ac04014.tar.gz chat-c277a98b5d88c81df39f8e33ef1286f72ac04014.tar.bz2 chat-c277a98b5d88c81df39f8e33ef1286f72ac04014.zip |
Merge branch 'master' into mm-1420
Diffstat (limited to 'model')
-rw-r--r-- | model/client.go | 2 | ||||
-rw-r--r-- | model/utils.go | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/model/client.go b/model/client.go index ad1e4b5f1..17bb898ca 100644 --- a/model/client.go +++ b/model/client.go @@ -552,7 +552,7 @@ func (c *Client) GetFile(url string, isFullUrl bool) (*Result, *AppError) { if isFullUrl { rq, _ = http.NewRequest("GET", url, nil) } else { - rq, _ = http.NewRequest("GET", c.Url+url, nil) + rq, _ = http.NewRequest("GET", c.Url+"/files/get"+url, nil) } if len(c.AuthToken) > 0 { diff --git a/model/utils.go b/model/utils.go index 38592b984..093a54e38 100644 --- a/model/utils.go +++ b/model/utils.go @@ -319,6 +319,6 @@ func ClearMentionTags(post string) string { } var UrlRegex = regexp.MustCompile(`^((?:[a-z]+:\/\/)?(?:(?:[a-z0-9\-]+\.)+(?:[a-z]{2}|aero|arpa|biz|com|coop|edu|gov|info|int|jobs|mil|museum|name|nato|net|org|pro|travel|local|internal))(:[0-9]{1,5})?(?:\/[a-z0-9_\-\.~]+)*(\/([a-z0-9_\-\.]*)(?:\?[a-z0-9+_~\-\.%=&]*)?)?(?:#[a-zA-Z0-9!$&'()*+.=-_~:@/?]*)?)(?:\s+|$)$`) -var PartialUrlRegex = regexp.MustCompile(`/api/v1/files/(get|get_image)/([A-Za-z0-9]{26})/([A-Za-z0-9]{26})/(([A-Za-z0-9]+/)?.+\.[A-Za-z0-9]{3,})`) +var PartialUrlRegex = regexp.MustCompile(`/([A-Za-z0-9]{26})/([A-Za-z0-9]{26})/((?:[A-Za-z0-9]{26})?.+\.[A-Za-z0-9]{3,})`) var SplitRunes = map[rune]bool{',': true, ' ': true, '.': true, '!': true, '?': true, ':': true, ';': true, '\n': true, '<': true, '>': true, '(': true, ')': true, '{': true, '}': true, '[': true, ']': true, '+': true, '/': true, '\\': true} |