Wikipedia Diskussion:Lua/Modul/URL
Erscheinungsbild
Vorlagenprogrammierung | Diskussionen | Lua | Unterseiten | |||
Modul | Deutsch | English
|
Modul: | Dokumentation |
nic.
„Wenn ein Domänenname nur aus einer TLD besteht, wird die Adresse zu "nic." + TLD erweitert.“ – warum wird dies gemacht? --ɱ 13:12, 21. Jan. 2023 (CET) PS: davon abgesehen ist der Quellcode durch fast fehlende Kommentierung durch Dritte unwartbar
- Die Erweiterung auf die Adresse des entsprechenden NIC geschieht, weil der für die TLD verantwortlich ist. Ziel sollte sein, dass jede gültige Domäne auch erreichbar ist.
- Das Modul ist erkennbar noch nicht vollständig. Dass die Dokumentation vervollständigt wird, ist mein Ziel.
- --Vollbracht (Diskussion) 22:07, 21. Jan. 2023 (CET)
- „weil der für die TLD verantwortlich ist.“? erstens kommt da stellenweise blödsinn raus:
- 1. Dreamhost, Hosting-Anbieter oder z.B.:
$ host nic.uk nic.uk mail is handled by 5 rav.nic.uk. nic.uk mail is handled by 10 mxa.nic.uk. nic.uk mail is handled by 10 mxb.nic.uk.
- 2. der eigentliche Punkt, tippe mal in eine Shell
host com
oderhost de
und lese dir die Ausgabe durch. Denke anschließend über den Satz „Ziel sollte sein, dass jede gültige Domäne auch erreichbar ist.“ nach. --ɱ 01:14, 22. Jan. 2023 (CET)- Was schlägst Du vor? --Vollbracht (Diskussion) 01:21, 22. Jan. 2023 (CET)
- RFCs lesen und verstehen, bevor man solche Module programmiert. Ein nic. hinzuzufügen ist Frickelei³ am Standard vorbei, dies sollte komplett entfernt werden. Dann ist die Benennung fehlerhaft und der Aufbau, den du gewählt hast. Ein Anfang zum besseren Verständnis wäre Uniform Resource Identifier#Aufbau sowie das obsolete Uniform Resource Locator#Beispiele und natürlich https://www.rfc-editor.org/rfc/rfc3986 --ɱ 02:02, 22. Jan. 2023 (CET)
- Was schlägst Du vor? --Vollbracht (Diskussion) 01:21, 22. Jan. 2023 (CET)
- 2. der eigentliche Punkt, tippe mal in eine Shell
Ich hab mal ChatGPT den Code analysieren lassen:
Sure, below is a list of potential issues with the provided code:
- The function
service:new(link)
does not handle invalid URLs and returns nil without providing any error message. - The method
format
has some issues in processing format strings, it doesn't check if the placeholders in the format string are actually valid fields of the URL object. - The code doesn't provide a way to modify the URL object after it is created, for example, by using a set or update method.
- The function
service:new(link)
uses string manipulation and regular expression to parse the URL into the fields protocol, server, domain, TLD, subdomain, path, file, parameters, and portion and it may have issues if the structure of the URLs is not as expected or there is no regularity in the URL. - The code uses some regular expressions to parse the URLs, but it does not guarantee that it can recognize and parse all valid URLs as specified in the RFC 3986.
- The code divides the URLs into fields such as protocol, server, domain, TLD, subdomain, path, file, parameters, and portion, but these fields are not all defined in the RFC 3986.
- The code does not handle invalid URLs as specified in the RFC 3986, it does not provide any error handling mechanism.
- The list
eTLDs
may not be complete, so it may not be able to identify all valid TLDs. - The relative() method is mentioned as to-be-implemented but not defined in the code.
- The code does not handle internationalized domain names(IDNs) and punycode correctly.
- The code does not handle IPv6 addresses correctly.
- The code does not handle userinfo and fragment parts in the URLs correctly.
- The code does not handle relative URLs correctly.
It's important to note that this is not an exhaustive list and there may be other issues present in the code. It's recommended to thoroughly review and test the code before using it in a production environment. --ɱ 01:04, 23. Jan. 2023 (CET)