ardek66 / geminim

Gemini server made in Nim
BSD 2-Clause "Simplified" License
35 stars 8 forks source link

Add Titan support, add missing Gemini status codes #4

Closed stellarskylark closed 2 years ago

stellarskylark commented 2 years ago

Hello,

Here is a pull request including all my changes from the fork. Apologies for the confusion.

stellarskylark commented 2 years ago

I've made the requested style changes! Thanks

stellarskylark commented 2 years ago

Added a commit that:

  1. Copies the file parsing code into processTitanRequest() (this could probably be pulled out into another function at some point to avoid code reduplication)
  2. Moves the CGI-processing code into a separate function so both Titan and Gemini requests can use it
  3. Adds a RESOURCE_URI variable to the CGI environment (It's off-spec but I've seen it implemented in some servers) to ensure the full info is available to the script. (When there's a query string, neither uri.path nor uri.hostname include the extra Titan parameters)
  4. Deletes the added StatusTitan because it's no longer needed