Comments (6)
Let's go with the error then
from swarm.
possibly related: #166
from swarm.
The first approach seems like the most feasible if we really want to actually display the content seamlessly. API consistency would lead to actually throwing an error. A few questions:
- should this reflect just on GET operations? or do we want to reflect on all CRUD operations? I would just fear how clients will handle a redirect on a POST/DELETE (in case it's a custom client)
- should this reflect on all GET operations, or just when fetching the root hash? (e.g. also on
HandleGetList
,HandleGetFile
etc) - the hash could hypothetically start with a
0x
, which means we need to introduce hash size checks, which in turn means tight coupling with the hashing algorithm (not a big fan of this idea)
from swarm.
@elad-nach
- POST and PUT is only available in case of bzz-raw requests, either without a hash (upload), then the question is not relevant (no hash to add
0x
to), or with a hash and a path (to add a manifest entry). See http://swarm-guide.readthedocs.io/en/latest/usage.html?highlight=post#the-http-api . The manifest update is a relevant case, I'm not sure what we should do, I agree that redirect could be problematic. - I think all GET operations should be affected, I don't see that problematic
Doesnt' this problem suggest that maybe the second solution is better: "Serve the same content at 0xHASH as you would at HASH"
@homotopycolimit ?
from swarm.
i think that requested resource should reflect itself - a browser/client should redirect and request the correct resource name and not transparently serve resource aliases. less magic and less abstraction that we need to maintain.
it might also lead to implementation divergence when 3rd party developers will interface to the API, leaving us with a necessity to support both interfaces in the future.
thinking about this more - it looks more tempting to actually throw a helpful error rather than supporting both implementations. but in any case it might be nice to have a look at the swarm-gateways access logs and see if anyone at the moment tries to access resources this way.
from swarm.
but in any case it might be nice to have a look at the swarm-gateways access logs and see if anyone at the moment tries to access resources this way.
I found the error from somebody's question in the swarm channel.
It is also confusing that when registering a swarm hash in the ENS you have to add the 0x. This is unfortunate.
I don't mind an error message.... we could even have the error page offer the corrected link.
from swarm.
Related Issues (20)
- bug: sometimes serves index.html files within a folder, sometimes does not
- repair globally pinned content without manifest HOT 4
- pinned content disappears when gc is triggered multiple times HOT 2
- add push-sync flag HOT 1
- use bzzaccounts as publishers in global pinning HOT 1
- fix conflict between garbage collection and push sync HOT 1
- fix content recovery request flooding HOT 1
- add global pinning logs HOT 1
- add global pinning simulation test
- flood of recovery requests
- lookup timeout on feed content recovery
- Files from specific sizes instantly disappear after encryption HOT 1
- Swarm Go.1.14 Build FAILED HOT 1
- Files from a Feed are cached by browser HOT 3
- Incompatible with latest go-ethereum v1.9.23 HOT 2
- Does swarm support IPv6 network?
- Deprecation notice HOT 4
- Bzzaar rejected by infura
- Swarm HOT 1
- Error: provided network ID does not match mainnet HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from swarm.