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

Inconsistent handling of undefined URL params #48

Closed
seriema opened this issue Oct 18, 2015 · 1 comment
Closed

Inconsistent handling of undefined URL params #48

seriema opened this issue Oct 18, 2015 · 1 comment
Labels
Milestone

Comments

@seriema
Copy link
Owner

seriema commented Oct 18, 2015

While working on #44 to raise test-coverage I noticed that empty URL params were handled differently depending on if it's an undefined property on the $http config object, or if it's just an empty value in the URL.

Test cases

Case 1: empty value in URL

defaultRequest.url = '/api/pokemon?releaseDate';

becomes
/mock_data/pokemon/releasedate=.get.json.

Case 2: undefined value in object

defaultRequest.url = '/api/pokemon';
defaultRequest.params = {
  'releaseDate': undefined
};

becomes
/mock_data/pokemon/releasedate=undefined.get.json

Wanted result

= and =undefined are both unwanted in a file name IMHO. So it should be completely removed. I.e. expected file path would be /mock_data/pokemon/releasedate.get.json.

@seriema seriema added the bug label Oct 18, 2015
@seriema seriema added this to the 0.3.x milestone Oct 18, 2015
@seriema
Copy link
Owner Author

seriema commented Oct 18, 2015

It could be considered a breaking change and thus a major version bump, but I see it as undefined/unexpected/undocumented behaviour. So if someone's relying on it it wasn't safe, and fixing this should make it better for everyone.

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

No branches or pull requests

1 participant