question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Returning HTML not raw text.

See original GitHub issue

Am I missing something?

bash-3.2$ curl cheat.sh/tar
... snip ...
<a href="https://twitter.com/igor_chubin" class="twitter-follow-button" data-show-count="false" data-button="grey">Follow @igor_chubin</a>
<script>!function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0],p=/^http:/.test(d.location)?'http':'https';if(!d.getElementById(id)){js=d.createElement(s);js.id=id;js.src=p+'://platform.twitter.com/widgets.js';fjs.parentNode.insertBefore(js,fjs);}}(document, 'script', 'twitter-wjs');</script>

<!-- Place this tag where you want the button to render. -->
<a aria-label="Star chubin/wttr.in on GitHub" data-count-aria-label="# stargazers on GitHub" data-count-api="/repos/chubin/cheat.sh#stargazers_count" data-count-href="/chubin/cheat.sh/stargazers" data-icon="octicon-star" href="https://github.com/chubin/cheat.sh" class="github-button">cheat.sh</a>
<!-- Place this tag where you want the button to render. --><a aria-label="Star chrisallenlane/cheat on GitHub" data-count-aria-label="# stargazers on GitHub" data-count-api="/repos/chrisallenlane/cheat#stargazers_count" data-count-href="/chrisallenlane/cheat/stargazers" data-icon="octicon-star" href="https://github.com/chrisallenlane/cheat"  class="github-button">cheat</a>
<!-- Place this tag right after the last button or just before your close body tag. -->
<script async defer id="github-bjs" src="https://buttons.github.io/buttons.js"></script>
</body>
</html>

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
chubincommented, Aug 18, 2018

@yyyc514 Hi Josh!

Now we have a special configuration option, CHTSH_CURL_OPTIONS, to specify curl command line options that should be used in cht.sh for making curl calls. In your case it would be:

CHTSH_CURL_OPTIONS='-A curl'

in the cht.sh config file (located at ~/.cht.sh/cht.sh.conf).

0reactions
joshgoebelcommented, Aug 3, 2018

Sure. Doesn’t hurt for the binary to be explicit about its user agent.

Read more comments on GitHub >

github_iconTop Results From Across the Web

return html for a web server and not plain text in python
-1: Correct answer is "Use an existing web server." This answer should say "As a fall-back, if you insist on doing twice as...
Read more >
3 ways to convert HTML text to plain text - DEV Community ‍ ‍
3 ways to convert HTML text to plain text · 1) Using .replace(/<[^>]*>/g, '') · 2) Create a temporary DOM element and retrieve...
Read more >
Returning Plain HTML From a Spring MVC Controller | Baeldung
Learn how to return HTML from a Spring MVC controller.
Read more >
.html() | jQuery API Documentation
This method uses the browser's innerHTML property. Some browsers may not return HTML that exactly replicates the HTML source in an original document....
Read more >
Custom Response - HTML, Stream, File, others - FastAPI
Takes some text or bytes and returns an plain text response. from fastapi import FastAPI from fastapi.responses import PlainTextResponse app = FastAPI() ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found