fix: fix expand variable for vars with hyphens or dots

fixes #926
This commit is contained in:
Roman Hotsiy 2020-06-27 19:41:08 +03:00
parent 633d71293f
commit 0904b3fec2
No known key found for this signature in database
GPG Key ID: 5CB7B3ACABA57CB0

View File

@ -512,7 +512,7 @@ export function mergeSimilarMediaTypes(
export function expandDefaultServerVariables(url: string, variables: object = {}) {
return url.replace(
/(?:{)(\w+)(?:})/g,
/(?:{)([\w-.]+)(?:})/g,
(match, name) => (variables[name] && variables[name].default) || match,
);
}