Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[email protected] breaks templating in url #11

Open
rjrahul opened this issue Jan 9, 2017 · 2 comments
Open

[email protected] breaks templating in url #11

rjrahul opened this issue Jan 9, 2017 · 2 comments

Comments

@rjrahul
Copy link
Member

rjrahul commented Jan 9, 2017

In latest version, variable-templating breaks in URL of the operation template. Reason for this is the use of url.resolve that causes variable-template string "{variable}" to get parsed into URL format and internally loopback-connector-rest uses string match to determine if variable-template is being used.

Reverted the fix in PR#10

@rjrahul
Copy link
Member Author

rjrahul commented Jan 10, 2017

We can possibly use decodeURI V8 method to do URI decoding. Check for all characters is done as follows using REPL

> var b = url.resolve('https://abc.com/','/abc~a!b@c$d*e(f)?a=b\\c&b={de},f^g;`k|j+"de"&c=\'<a>\'#fragment')
undefined
> b
'https://abc.com/abc~a!b@c$d*e(f)?a=b%5Cc&b=%7Bde%7D,f%5Eg;%60k%7Cj+%22de%22&c=%27%3Ca%3E%27#fragment'
> decodeURI(b)
'https://abc.com/abc~a!b@c$d*e(f)?a=b\\c&b={de},f^g;`k|j+"de"&c=\'<a>\'#fragment'

@DerekTBrown
Copy link

+1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants