(name string)
| 760 | } |
| 761 | |
| 762 | func (jfs justFilesSystem) Open(name string) (fs.File, error) { |
| 763 | f, err := jfs.FS.Open(name) |
| 764 | if err != nil { |
| 765 | return nil, err |
| 766 | } |
| 767 | |
| 768 | stat, err := f.Stat() |
| 769 | if err != nil { |
| 770 | return nil, err |
| 771 | } |
| 772 | |
| 773 | // Returning a 404 here does prevent the http.FileServer from serving |
| 774 | // index.* files automatically. Coder handles this above as all index pages |
| 775 | // are considered template files. So we never relied on this behavior. |
| 776 | if stat.IsDir() { |
| 777 | return nil, os.ErrNotExist |
| 778 | } |
| 779 | |
| 780 | return f, nil |
| 781 | } |
| 782 | |
| 783 | // RenderOAuthAllowData contains the variables that are found in |
| 784 | // site/static/oauth2allow.html. |
no outgoing calls