Giter VIP home page Giter VIP logo

Comments (6)

gbalint avatar gbalint commented on May 31, 2024 1

Let's go with the error then

from swarm.

cobordism avatar cobordism commented on May 31, 2024

possibly related: #166

from swarm.

acud avatar acud commented on May 31, 2024

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.

gbalint avatar gbalint commented on May 31, 2024

@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.

acud avatar acud commented on May 31, 2024

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.

cobordism avatar cobordism commented on May 31, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.