Protect against invalid package sources

This commit is contained in:
Jay McCarthy 2013-05-22 21:09:45 -06:00
parent a8111ce91b
commit 16e4f707e9

View File

@ -160,12 +160,14 @@
(string->url pkg-url-str)) (string->url pkg-url-str))
(match (url-scheme pkg-url) (match (url-scheme pkg-url)
["github" ["github"
(match-define (list* user repo branch path) (match (url-path pkg-url)
(url-path pkg-url)) [(list* user repo branch path)
(url->string (url->string
(struct-copy url pkg-url (struct-copy url pkg-url
[scheme "http"] [scheme "http"]
[path (list* user repo (path/param "tree" empty) branch path)]))] [path (list* user repo (path/param "tree" empty) branch path)]))]
[_
pkg-url-str])]
[_ [_
pkg-url-str])) pkg-url-str]))