Skip to content
This repository has been archived by the owner on Aug 9, 2024. It is now read-only.

BUG: Not fetching html from server IP #187

Open
Nocturnalx opened this issue Jun 9, 2024 · 1 comment
Open

BUG: Not fetching html from server IP #187

Nocturnalx opened this issue Jun 9, 2024 · 1 comment
Labels
bug Something isn't working

Comments

@Nocturnalx
Copy link

Nocturnalx commented Jun 9, 2024

Describe the bug
After fetching a standalone IP from the DNS lookup and passing it to build_ui()->parse_html()->fetch_file(), the reqwest::get() causes an error if the IP does not specify http://<xx.xx.xx.xx>.

To Reproduce

  1. register domain name to an IP address without adding http:// before hand
  2. attempt to access registered domain via the url input

Expected behavior
Browser and/or DNS server should ensure "http://" is added to the address before performing any kind of fetch on it to prevent an error from reqwest.

Desktop (please complete the following information):
Arch linux
reqwest version 0.12.3

Additional context
I have a very simple check ready to PR for if the returned json.ip can be parsed as a standalone IP within fetch_dns() (main.rs:584), but that should really only be done after the DNS has been normalised to either return or not return the http:// prefix on lookup. e22cac9

Also i noticed Url::parse() (html.rs: parse_html(): line 34) breaks on a standalone IP not being a readable url so never appends index.html but this is just the same problem of a lack of http:// as the fetch issue.

@Nocturnalx Nocturnalx added the bug Something isn't working label Jun 9, 2024
@Nocturnalx
Copy link
Author

I can confirm changing the domain registration url to include "http://" before the IP fixed the issue when accessing with the current master branch release, I also noticed that the prompt does say to just input the IP as a standalone IP.

Nocturnalx added a commit to Nocturnalx/webx that referenced this issue Jun 9, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant