How can I cancel this query string?

I am sending this request to the service:

get_store_data = Typhoeus::Request.new("http://localhost:3000/api/v1/store?service=#{(proxy_ticket.service)}&ticket=#{proxy_ticket.ticket}")

proxy_ticket.serviceallows this line "http://localhost:3000/api/v1/store". When the request is sent, this line escapes to the following:

service=http%3A%2F%2Flocalhost%3A3000%2Fapi%2Fv1%2Fstore

The problem is that the service on the other end is expecting a service parameter, how "http://localhost:3000/api/v1/store", how can I prevent this query string?

+4
source share
2 answers

You can not. Its “other side”, which should decrypt this parameter (and, most likely, they do it).

, . , raise params.pretty_inspect your/action/route?service=http%3A%2F%2Flocalhost%3A3000%2Fapi%2Fv1%2Fstore. , service: http://localhost:3000/api/v1/store.

, , . URL- URL-.

+1

. , , uri.unescape, :

require 'uri'

enc_uri = URI.escape("http://example.com/?a=\11\15")
p enc_uri
# => "http://example.com/?a=%09%0D"

p URI.unescape(enc_uri)
# => "http://example.com/?a=\t\r"

- ( - , , , - .)

+5

Source: https://habr.com/ru/post/1539005/


All Articles