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

Boolean query parameters incorrectly parsed #57

Closed
MicaelJarniac opened this issue Jul 15, 2020 · 1 comment · Fixed by #62
Closed

Boolean query parameters incorrectly parsed #57

MicaelJarniac opened this issue Jul 15, 2020 · 1 comment · Fixed by #62
Labels
bug Something isn't working.

Comments

@MicaelJarniac
Copy link
Contributor

The boolean query parameters, such as show_icons, hide_border and hide_rank, are being incorrectly parsed, as passing false to them has the same effect as if passing true:


All true

With all the settings set to true, the behavior is as expected.

https://github-readme-stats.vercel.app/api?username=MicaelJarniac&show_icons=true&hide_border=true&hide_rank=true


All false

But with all settings set to false, the behavior should be the same as the default one, with no extra query at all, but it isn't.

https://github-readme-stats.vercel.app/api?username=MicaelJarniac&show_icons=false&hide_border=false&hide_rank=false


Default (no extra query)

https://github-readme-stats.vercel.app/api?username=MicaelJarniac


I believe what's happening is that the only thing being checked is whether they exist or not, and not what their values actually are.

This isn't directly affecting the usage, but is a small detail that can be rather confusing at times.

For example, I like to tweak the settings from time to time, and to make it easier, I like to have all the settings explicitly declared, so I can easily see which ones are available, and simply change their values. With the way the query is being parsed right now, that wouldn't be an option, as I'd actually have to remove the setting completely in order to change its effect.

@anuraghazra anuraghazra added the bug Something isn't working. label Jul 15, 2020
@anuraghazra
Copy link
Owner

Thank you for reporting the issue @MicaelJarniac fix is on its way

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants