Skip to content

Static files. Spaces in path. #839

Closed
@manfredmann

Description

@manfredmann

When static path contains spaces, server returns 404 error.

Code:

  e := echo.New()
  e.Static("/storage", config.Main.StorageDir); //config.Main.StorageDir contains string "storage"
  e.GET("/", api.Index)
....
Some e.POST
....
  err = e.Start(fmt.Sprintf("%s:%d", config.Main.ServerListen, config.Main.ServerPort))

"storage" directory structure for example:

storage/1.txt //Contains record "1"
storage/1 1.txt //Contains record "1 1"
manfredmann@lucille ~/G/mhapiserver> curl "http://localhost:3000/storage/1.txt"
1
manfredmann@lucille ~/G/mhapiserver> curl "http://localhost:3000/storage/1%201.txt"
{"message":"Not Found"} 
manfredmann@lucille ~/G/mhapiserver>

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions