forked from jriou/coller
Compare commits
No commits in common. "401397241b9c93f42854eb411c8a391da011d81f" and "792eff78cc154d73a5412c4e6cfec9c57e22fdb6" have entirely different histories.
401397241b
...
792eff78cc
1 changed files with 1 additions and 7 deletions
|
@ -246,7 +246,7 @@ func (h *CreateNoteWithFormHandler) ServeHTTP(w http.ResponseWriter, r *http.Req
|
||||||
}
|
}
|
||||||
|
|
||||||
h.logger.Debug("checking file content type")
|
h.logger.Debug("checking file content type")
|
||||||
if !strings.HasPrefix(handler.Header.Get("Content-Type"), "text/") {
|
if handler.Header.Get("Content-Type") != "text/plain" {
|
||||||
h.PageData.Err = fmt.Errorf("text file expected (got %s)", handler.Header.Get("Content-Type"))
|
h.PageData.Err = fmt.Errorf("text file expected (got %s)", handler.Header.Get("Content-Type"))
|
||||||
h.Templates.ExecuteTemplate(w, templateName, h.PageData)
|
h.Templates.ExecuteTemplate(w, templateName, h.PageData)
|
||||||
return
|
return
|
||||||
|
@ -377,12 +377,6 @@ func (h *GetProtectedWebNoteHandler) ServeHTTP(w http.ResponseWriter, r *http.Re
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
if note == nil {
|
|
||||||
h.PageData.Err = fmt.Errorf("Note doesn't exist or has been deleted")
|
|
||||||
h.Templates.ExecuteTemplate(w, templateName, h.PageData)
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
if password != "" && note.Encrypted {
|
if password != "" && note.Encrypted {
|
||||||
note.Content, err = internal.Decrypt(note.Content, password)
|
note.Content, err = internal.Decrypt(note.Content, password)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue