curl-to-csharp icon indicating copy to clipboard operation
curl-to-csharp copied to clipboard

"^" Problem

Open ebubekirbastama opened this issue 2 years ago • 5 comments

It adds "^" when a curl copy request is received from the Web Browser. It would be nice if you add code to delete this character :)

ebubekirbastama avatar Jun 30 '23 07:06 ebubekirbastama

Hi @ebubekirbastama 🤝

Hm, I don't quite understand the issue. Could you please provide more information?

olsh avatar Jun 30 '23 09:06 olsh

Of course. For example, I opened "https://curl.olsh.me/" in the Google browser, clicked on "inspect," navigated to the Network section, and copied the cURL command for the Get request.

The example request is below. curl "https://curl.olsh.me/" ^ -H "authority: curl.olsh.me" ^ -H "accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,/;q=0.8,application/signed-exchange;v=b3;q=0.7" ^ -H "accept-language: tr-TR,tr;q=0.9,en-US;q=0.8,en;q=0.7" ^ -H "cache-control: no-cache" ^ -H "pragma: no-cache" ^ -H "referer: https://www.google.com/" ^ -H "sec-ch-ua: ^^"Not.A/Brand^^";v=^^"8^^", ^^"Chromium^^";v=^^"114^^", ^^"Google Chrome^^";v=^^"114^^"" ^ -H "sec-ch-ua-mobile: ?0" ^ -H "sec-ch-ua-platform: ^^"Windows^^"" ^ -H "sec-fetch-dest: document" ^ -H "sec-fetch-mode: navigate" ^ -H "sec-fetch-site: cross-site" ^ -H "sec-fetch-user: ?1" ^ -H "upgrade-insecure-requests: 1" ^ -H "user-agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/114.0.0.0 Safari/537.36" ^ --compressed

As seen, this '^' character is added to the code. Could you please add the code for clearing the code on the left side?

ebubekirbastama avatar Jun 30 '23 10:06 ebubekirbastama

I bielive that you use Windows and Chrome 114. Here is result from Chrome 114 on MacOS.

curl 'https://curl.olsh.me/' \
  -H 'authority: curl.olsh.me' \
  -H 'accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.7' \
  -H 'accept-language: en-US,en;q=0.9,ru;q=0.8' \
  -H 'cache-control: no-cache' \
  -H 'dnt: 1' \
  -H 'pragma: no-cache' \
  -H 'referer: https://github.com/' \
  -H 'sec-ch-ua: "Not.A/Brand";v="8", "Chromium";v="114", "Google Chrome";v="114"' \
  -H 'sec-ch-ua-mobile: ?0' \
  -H 'sec-ch-ua-platform: "macOS"' \
  -H 'sec-fetch-dest: document' \
  -H 'sec-fetch-mode: navigate' \
  -H 'sec-fetch-site: cross-site' \
  -H 'sec-fetch-user: ?1' \
  -H 'upgrade-insecure-requests: 1' \
  -H 'user-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/114.0.0.0 Safari/537.36' \
  --compressed

I'll try to fix this when I have Windows PC.

olsh avatar Jun 30 '23 10:06 olsh

:) just a replace code is enough :) string request ="ebstime ^" string editcode =request.replace("^",""); :)

ebubekirbastama avatar Jun 30 '23 10:06 ebubekirbastama

Nope, just replacing is not enough. What if you have a value with ^ char?

olsh avatar Jun 30 '23 10:06 olsh