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

Regression from v1 to v2 phone number lookups-- URI no longer encoded #659

Open
bf4 opened this issue Jun 1, 2023 · 1 comment
Open
Labels
status: help wanted requesting help from the community type: bug bug in the library

Comments

@bf4
Copy link

bf4 commented Jun 1, 2023

Issue Summary

Same issue as #406

I see from v1 https://github.com/twilio/twilio-ruby/blob/6.0.2/lib/twilio-ruby/rest/lookups/v1/phone_number.rb#L53 to v2 the escaping was removed.

-                        @uri = "/PhoneNumbers/#{CGI.escape(@solution[:phone_number]).gsub("+", "%20")}"
+                        @uri = "/PhoneNumbers/#{@solution[:phone_number]}"

Proposal

use URI::DEFAULT_PARSER.escape just like Rails does

                        @uri = "/PhoneNumbers/#{URI::DEFAULT_PARSER.escape(@solution[:phone_number])}"

Steps to Reproduce

  1. look up a phone number with a space in it

see #406

Code Snippet

see #406

Exception/Log

see #406

Technical details:

  • twilio-ruby version: 6.0.1
  • ruby version: 3.1
@AsabuHere
Copy link
Contributor

AsabuHere commented Jun 20, 2023

Hi @bf4,

Thanks for the heads up!

This issue has been added to our internal backlog to be prioritised. Pull requests and +1s on the issue summary will help it move up the backlog.

With best regards,

Athira

@AsabuHere AsabuHere added type: bug bug in the library status: help wanted requesting help from the community labels Jun 20, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: help wanted requesting help from the community type: bug bug in the library
Projects
None yet
Development

No branches or pull requests

2 participants