philnash / bitly

🗜 A Ruby wrapper for the bit.ly API
https://rubygems.org/gems/bitly
MIT License
451 stars 139 forks source link

Strips protocol from bitlink if provided #82

Closed philnash closed 2 years ago

philnash commented 2 years ago

In #80 there was an unexpected 404 when using the full URL to expand a bitlink. While the API documentation shows that you should only use the domain and the short link as part of the request, a library like this can help out. This PR adds a utility function that can be used to strip a leading http or https protocol from the front of a provided bitlink, ensuring that API calls succeed.

Fixes #80

sonarcloud[bot] commented 2 years ago

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

100.0% 100.0% Coverage
0.0% 0.0% Duplication