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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Handle cht.sh 404 better #240

Closed
tennox opened this issue Mar 3, 2023 · 3 comments 路 Fixed by #243
Closed

Handle cht.sh 404 better #240

tennox opened this issue Mar 3, 2023 · 3 comments 路 Fixed by #243
Assignees

Comments

@tennox
Copy link
Contributor

tennox commented Mar 3, 2023

Took me a while to figure this out (and still don't know why cht.sh is doing this) but for some queries the second snippet returns 404 (but the next ones work again) 馃

But this issue is about handling it better, as this extension shows this:

Screenshot from 2023-03-03 16-35-46

Maybe a 404 could be shown as such?

@tennox
Copy link
Contributor Author

tennox commented Mar 3, 2023

Oh damn I just saw it returns HTTP 200:

$ http https://cht.sh/rust/flush+stdout/1
HTTP/1.1 200 OK
Connection: keep-alive
Content-Length: 1611
Content-Type: text/plain; charset=utf-8
Date: Fri, 03 Mar 2023 15:57:31 GMT
Server: nginx/1.13.12
Strict-Transport-Security: max-age=63072000; includeSubdomains
X-Content-Type-Options: nosniff
X-Frame-Options: DENY

/*
 * 404 NOT FOUND
 * 
 * Unknown cheat sheet. Please try to reformulate your query.
 * Query format:
 */

 /LANG/QUESTION

// Examples:

@tennox
Copy link
Contributor Author

tennox commented Mar 3, 2023

I opened a bug report on cheat.sh as that's kinda weird anyways:

chubin/cheat.sh#377

@VladBrok
Copy link
Collaborator

VladBrok commented Mar 3, 2023

Yeah, I think that this response from cht.sh looks fine:

/*
 * 404 NOT FOUND
 * 
 * Unknown cheat sheet. Please try to reformulate your query.
 * Query format:
 */

 /LANG/QUESTION

 // Examples:
 /python/read+json

But if the configuration option "verbose" is false, then the response looks weird. I think we can fix that聽

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants