Skip to content

Restore Guru: Wolfram|Alpha is HTTPS-only - #1

Open
SpitfireTN wants to merge 2 commits into
masterfrom
https-transport
Open

Restore Guru: Wolfram|Alpha is HTTPS-only#1
SpitfireTN wants to merge 2 commits into
masterfrom
https-transport

Conversation

@SpitfireTN

@SpitfireTN SpitfireTN commented Sep 2, 2026

Copy link
Copy Markdown
Owner

Guru as released can no longer reach Wolfram|Alpha. api.wolframalpha.com answers port 80 with a 308 redirect to https://, and C:http_get (Aminet, 2015) has no TLS and does not follow redirects.

Changes

Configurable transportg.fetchCmd / g.apiBase replace the hardcoded http_get and URL:

httpget + https://api.wolframalpha.com AmiSSL 5, native TLS, stays on the Amiga (recommended)
http_get + http://host:port keep http_get, point at a proxy that does the TLS leg

http_get takes -u, AmiSSL's httpget takes the URL alone; fetchWebRequest builds each accordingly. The startup existence check and its error message follow g.fetchCmd now.

Two response-format changes that broke Guru's own error handling:

  • Invalid AppId now returns bare Invalid appid, not Error 1: Invalid appid — a bad key was displayed as an answer rather than raising the AppId error.
  • 501 bodies 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.appId remains yourappidhere.

mkillewald and others added 2 commits April 19, 2023 01:54
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>
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 this pull request may close these issues.

2 participants