Skip to content
This repository has been archived by the owner on Jan 27, 2021. It is now read-only.

static serve index.html for folder path #63

Closed
felixboehm opened this issue Nov 9, 2020 · 3 comments · Fixed by owncloud/ocis#912
Closed

static serve index.html for folder path #63

felixboehm opened this issue Nov 9, 2020 · 3 comments · Fixed by owncloud/ocis#912

Comments

@felixboehm
Copy link

Static middleware
https://github.com/owncloud/ocis-pkg/blob/master/middleware/static.go#L28

Serving NotFound for folder ("/") instead of index.html

@butonic
Copy link
Member

butonic commented Nov 10, 2020

what endpoint do you want to make a get request with? AKA where should documents be published? To be safe they should be rendered on a separate domain that has no access rights to the ocis instance. ... eg by preventing any CORS requests.

If the static files should be generated from files within a cs3 storage provider / the users home / another space then they need to either be shared ro with new properties so that the public facing API knows that it should render HTML instead of treating it as a download ...

This could be an extension in itself?

@C0rby
Copy link
Contributor

C0rby commented Nov 13, 2020

@butonic, I don't quite get your comment.

I think what @felixboehm wants is something like this:
The if is in line 27:

if r.URL.Path != root && strings.HasSuffix(r.URL.Path, "/") {
  http.NotFound(w, r)
} else {
  static.ServeHTTP(w, r)
}

If an extension is using the Static middleware and a request againt / is sent it should return the index.html if there is one in the extension's folder. Otherwise it will do a directory listing of the extension's root folder.

@kulmann
Copy link
Contributor

kulmann commented Nov 20, 2020

Will be fixed by owncloud/ocis#912

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants