RangerMauve / hypercore-fetch

Implementation of Fetch that uses the Hyper SDK for loading p2p content
MIT License
37 stars 13 forks source link

Change: (test.js) Use valid z32 encoding in nonexistent URL #68

Closed josephmturner closed 1 year ago

josephmturner commented 1 year ago

This request should fail, but it doesn't.

RangerMauve commented 1 year ago

This is happening because I haven't added code which throws an error if there's no peers/data found yet.

josephmturner commented 1 year ago

I consolidated the invalid URL tests into one, which tests for invalid domains and z32 public keys.

RangerMauve commented 1 year ago

Is this still necessary?

josephmturner commented 1 year ago

Is this still necessary?

Yes, I think so.

This is happening because I haven't added code which throws an error if there's no peers/data found yet.

I think we still want hypercore-fetch to return an error when there are no peers for a hyperdrive, right?

I just tried loading a "fake" valid z32 encoded url with the latest hyper-gateway, and I got status 200 with ETag 1. Is that expected?

josephmturner commented 1 year ago

I rebased off master. Looks like this is still an issue.

RangerMauve commented 1 year ago

My only worry is that invalid public keys can be useful for extension messages. But I think I can special case that for the $/extensions subpath.