Skip to content

Commit

Permalink
Merge pull request #50 from tape-tv/handle-empty-tracking-urls
Browse files Browse the repository at this point in the history
don't try to resolve invalid urls
  • Loading branch information
briganti committed Sep 11, 2014
2 parents 2586dfc + 625e24a commit 4980d00
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/util.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ class VASTUtil

for URLTemplate in URLTemplates
resolveURL = URLTemplate
continue unless resolveURL
for key, value of variables
macro1 = "[#{key}]"
macro2 = "%%#{key}%%"
Expand Down
3 changes: 3 additions & 0 deletions test/util.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -20,3 +20,6 @@ describe 'VASTUtil', ->

it 'should resolve weird cases', ->
resolve("http://test.com/%%CONTENTPLAYHEAD%%&[CONTENTPLAYHEAD]", CONTENTPLAYHEAD: 120).should.equal "http://test.com/120&120"

it 'should handle undefined', ->
should(resolve(undefined)).equal undefined

0 comments on commit 4980d00

Please sign in to comment.