fxa / uritemplate-js

An javascript implementation of RFC6570 Uri Templates
MIT License
97 stars 20 forks source link

Incorrect handling of optional named operator when all values are null #10

Closed Paul-Martin closed 11 years ago

Paul-Martin commented 11 years ago

UriTemplate.parse('/foo{?a,b,c}').expand({}); produces "/foo?c=" should be "/foo"

same for operators '&' and ';'

It seems to me that 'if (isFirstVarspec)' block starting at line 668 is unnecessary and removing it will resolve this issue without unwanted side effects. .

fxa commented 11 years ago

Of course, you are right. But I had some side effects, when removing this block. I will add your test case and fix the bug