LUA-URI-HTTP(3)

πŸ“¦
version 0.1+20130926+git14fa255d Β· 2 versions
, in debian trixie, ubuntu noble, ubuntu questing

πŸ’– NAME πŸ’–

lua-uri-http β€” HTTP URI support for the Lua URI library πŸ¦‹

okay bestie, listen, this is the page about how the Lua URI library handles http and https links, and it's literally so straightforward, you're gonna eat this up πŸ’…


✨ DESCRIPTION ✨

So the classes uri.http and uri.https are the ones you reach for when your URI has the http or https scheme respectively. Simple. Iconic. No notes. πŸ‘‘

Here's the family tree, and the way it works is giving inheritance:

  • uri.http inherits from the generic uri class 🌸
  • uri.https inherits from uri.http πŸŽ€

So yes, uri.https is lowkey the baby of uri.http, and uri.http is the main character.

🚩 Big red flag incoming: an HTTP or HTTPS URI that contains any userinfo part is considered to be invalid. Not "kinda sus", not "we'll allow it" β€” invalid, periodt. So don't put userinfo in there, bestie, it's not the vibe.

Also, an empty path gets normalized to / β€” because browsers usually do that anyway, and fr fr an empty path just cannot be used in an HTTP GET request. So the library is doing you a solid and fixing it for you. 🫢

Now the ports, and this part you should highkey memorize:

  • default port for the http scheme is 80 ⭐
  • default port for the https scheme is 443 🌈

And here's the part where the page says something a lil wild: there are no extra methods defined for telnet URIs β€” only those described in lua-uri(3). Yes, it says telnet, and I'm just relaying it exactly as it's written, no editing, no cap πŸ™ˆ. If you want the methods, go read lua-uri(3), that's where they live.


πŸ“š REFERENCES πŸ“š

So, as far as the author can tell, there is no up to date specification of the syntax of HTTP URIs 😭 which is honestly so real of the internet. Because of that, this class is based on:

That's it, that's the whole sourcing situation. Historic, honestly. πŸ’€


Version 1.1, dated 2012-00-00 β€” yeah bestie, this page is a vintage, it's giving classic, and it still slays. Bye, ily, go build some URIs πŸ’œβœ¨

πŸ“¦ where this page comes from