Skip to content
This repository was archived by the owner on Aug 2, 2021. It is now read-only.
This repository was archived by the owner on Aug 2, 2021. It is now read-only.

http server returns inconsistent results for requests with trailing segment in url #2071

@significance

Description

@significance

System information

Swarm version:
Swarm
Version: 0.5.4-stable
Go Version: go1.13.3
OS: darwin
OS & Version: OSX

Expected behaviour

Where 'default-path' is set to be index.html http://localhost:8500/bzz:/a123.../something should consistently return index.html so that Single Page Apps may use in browser routers eg. react-router.

Actual behaviour

If the trailing segment of the url matches any other entries in the manifest, these are returned instead.

Steps to reproduce the behaviour

sig :: Code/df/swarmtest2222 » tree .
.
├── assets
│   └── test.css
└── index.html

1 directory, 2 files
sig :: Code/df/swarmtest2222 » swarm --defaultpath index.html --recursive up .
2a05a416579d58484f7a1afb51e83c2a11b370bfc4baf1e85e8a0ebacd85286b
sig :: Code/df/swarmtest2222 » curl localhost:8500/bzz:/2a05a416579d58484f7a1afb51e83c2a11b370bfc4baf1e85e8a0ebacd85286b/
<!DOCTYPE html>
<html>
<head>
  <title>test</title>
</head>
<body>

</body>
sig :: Code/df/swarmtest2222 » curl localhost:8500/bzz:/2a05a416579d58484f7a1afb51e83c2a11b370bfc4baf1e85e8a0ebacd85286b/b
<!DOCTYPE html>
<html>
<head>
  <title>test</title>
</head>
<body>

</body>
sig :: Code/df/swarmtest2222 » curl localhost:8500/bzz:/2a05a416579d58484f7a1afb51e83c2a11b370bfc4baf1e85e8a0ebacd85286b/a
//test
sig :: Code/df/swarmtest2222 » cat assets/test.css
//test

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions