HelloZeroNet / HelloZeroNet/ZeroNet
Access-Control-Allow-Origin not added with transparent proxy requests
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 18.8k
- Forks
- 2.3k
- PR merge metrics
- No merged PRs in 30d
Description
Description
So I've been testing the new transparent proxy feature, and it's quite cool to just be able to type zerolstn.bit into the address bar and have it resolve appropriately. The only issue is that the font files don't seem to have the 'Access-Control-Allow-Origin' header included in the response. However, when using http://127.0.0.1/zerolstn.bit the header is included and the font files do load.
How to Reproduce
- Run ZeroNet on port 80 with a transparent proxy:
sudo python ./zeronet.py --ui_port 80 --ui_trans_proxy
- Change your
/etc/hostsfile to have localhost assigned tozerolstn.bit:
127.0.0.1 zerolstn.bit
- Visit
zerolstn.bitin your browser and see things load! But not the font files...
Cause
This little line here seems to be the issue:
Along with the code for isSameOrigin:
self.isSameOrigin is returning false for the zerolstn.bit address. I believe it is due to there being no 127.0.0.1:43110 in front of the site URL, so we may need to change some regex here.
Tagging @JeremyRand for his interest.
Thanks!
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start in src/Ui/UiRequest.py at the linked lines around the Access-Control-Allow-Origin response handling and isSameOrigin. Reproduce the transparent proxy setup with --ui_port 80 and --ui_trans_proxy, using zerolstn.bit in /etc/hosts, then compare the header behavior with http://127.0.0.1/zerolstn.bit. Done means font responses through the transparent proxy include the expected header.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- networking
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 35/100