Protecting the content of public/ in a Rails app

后端 未结 5 1124
刺人心
刺人心 2020-12-23 17:48

I\'m maintaining a Rails app that has content in the public/ folder that will now need to be protected by a login. We\'re considering moving those folders of files into a p

5条回答
  •  误落风尘
    2020-12-23 18:36

    Making the file available at an unpredictable URL is a simple solution currently used in some production systems.

    E.g.: GitLab. The following image was uploaded to an issue of a private repository, https://gitlab.com/cirosantilli/test-private/issues/1, but you can still see it:

    Note the unguessable 90574279de prefix automatically added to the URL.

    Bitbucket (non-Rails) also uses this technique.

提交回复
热议问题