Skip to content
This repository was archived by the owner on Apr 12, 2024. It is now read-only.

Appends slashes to urls #1064

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/ngResource/resource.js
Original file line number Diff line number Diff line change
Expand Up @@ -295,7 +295,7 @@ angular.module('ngResource', ['ng']).
});
query.sort();
url = url.replace(/\/*$/, '');
return url + (query.length ? '?' + query.join('&') : '');
return url + (query.length ? '?' + query.join('&') : '') + '/'; // append slashes to urls
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are you sure? You append a slash at the end of the url.

return url + (query.length ? '?' + query.join('&') : '') + '/';
foo?query1=1&query2=2/

I would made a bid for a line 297

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is an old pull request has been rejected already, I've made a local fix for django users but raises other issues.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Still facing the trailing slash issue with Django Rest Framework with Angular Resource.

}
};

Expand Down