Restore Guru: Wolfram|Alpha is HTTPS-only - #1
Open
SpitfireTN wants to merge 2 commits into
Open
Conversation
api.wolframalpha.com has answered port 80 with a 308 redirect to https for
some time now. C:http_get (Aminet, 2015) speaks plain HTTP only and does not
follow redirects, so Guru as released can no longer reach the API at all.
Make the transport configurable rather than hardcoding one fetch command:
g.fetchCmd "httpget" (AmiSSL 5, native TLS on the Amiga) or "http_get"
g.apiBase the API root, so http_get users can point at a proxy that
performs the TLS leg for them
http_get takes a -u user-agent and AmiSSL's httpget takes the URL alone, so
fetchWebRequest builds the command accordingly. The startup existence check
and its error message now follow g.fetchCmd instead of naming http_get.
Also handle two response-format changes that stopped Guru's own error
handling from matching:
- An invalid AppId now returns a bare "Invalid appid" rather than
"Error 1: Invalid appid", so a bad key fell through to be displayed as an
answer instead of raising the AppId error.
- 501 bodies now arrive wrapped in double quotes, e.g.
"Wolfram|Alpha did not understand your input". The == comparisons missed,
so Guru printed the error as a genuine answer with the footer attached.
Unwrapping is applied only when the unwrapped text is one of the known
error strings, so a real answer that happens to be a quotation is untouched.
Verified against the live API: both formats confirmed, and the unwrap logic
tested over quoted errors, a bare invalid-appid, a quoted genuine answer and a
plain answer.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
SpitfireTN
force-pushed
the
https-transport
branch
from
September 2, 2026 20:08
219a4b1 to
9d4a607
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Guru as released can no longer reach Wolfram|Alpha.
api.wolframalpha.comanswers port 80 with a308redirect tohttps://, andC:http_get(Aminet, 2015) has no TLS and does not follow redirects.Changes
Configurable transport —
g.fetchCmd/g.apiBasereplace the hardcodedhttp_getand URL:httpget+https://api.wolframalpha.comhttp_get+http://host:porthttp_gettakes-u, AmiSSL'shttpgettakes the URL alone;fetchWebRequestbuilds each accordingly. The startup existence check and its error message followg.fetchCmdnow.Two response-format changes that broke Guru's own error handling:
Invalid appid, notError 1: Invalid appid— a bad key was displayed as an answer rather than raising the AppId error.501bodies arrive quote-wrapped, e.g."Wolfram|Alpha did not understand your input"— the==tests missed, so the error printed as a real answer with the "powered by Wolfram|Alpha" footer attached.Unwrapping applies only when the unwrapped text matches a known error string, so a genuine answer that happens to be a quotation is left alone.
Verification
Both formats confirmed against the live API. Unwrap logic tested over quoted errors, a bare invalid-appid, a quoted genuine answer, and a plain answer — 5/5.
Not yet exercised end to end on an Amiga against AmiSSL
httpget; that is pending an AmiSSL install here.No local configuration or credentials included —
g.appIdremainsyourappidhere.