diff options
author | Stan Hu <stanhu@gmail.com> | 2018-03-13 22:27:19 +0300 |
---|---|---|
committer | Stan Hu <stanhu@gmail.com> | 2018-03-13 22:27:19 +0300 |
commit | 5a37d0e959cdd4eb97e153b4d2598d4efa30dded (patch) | |
tree | 7b461625a225dca3655d84704c282abe49e8d16c | |
parent | a38e722ca89b17cfe339c3f29e764e25df565841 (diff) |
Fix nil reference error when project is not in config.json
-rw-r--r-- | domain.go | 7 |
1 files changed, 6 insertions, 1 deletions
@@ -103,7 +103,12 @@ func (d *domain) isHTTPSOnly(r *http.Request) bool { } project := d.Projects[split[1]] - return project.HTTPSOnly + + if project != nil { + return project.HTTPSOnly + } + + return false } func (d *domain) serveFile(w http.ResponseWriter, r *http.Request, origPath string) error { |