-
Notifications
You must be signed in to change notification settings - Fork 27.5k
Respect PORT from URL without escaping #2652
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -106,6 +106,13 @@ describe("resource", function() { | |
R.get({a: 'foo', b: 'bar'}); | ||
}); | ||
|
||
it('should support por unescaped url', function() { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. typo : "por" -> "an" There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. My bad. This is to be fixed. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Is this better? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think it should be "should support an unescaped port in url" There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
var R = $resource('http://localhost:8080/Path/:a'); | ||
|
||
$httpBackend.expect('GET', 'http://localhost:8080/Path/foo').respond(); | ||
R.get({a: 'foo'}); | ||
}); | ||
|
||
|
||
it('should correctly encode url params', function() { | ||
var R = $resource('/Path/:a'); | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should the regex really be
^\d+$
? I.E. Only matches if all the characters are digit, in which case you don't need "g" modifier?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
\
had to be escaped. The "g" modifier can be dropped, that's right.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The difference is not the \ but the lack of $ at the end. As it stands this regex will match "1abc", which is probably not valid, either way, as a port or a parameter!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Indeed. I'll fix it shortly.