Commit 1c47f3d2 authored by Heiko Reese's avatar Heiko Reese
Browse files

m…

parent a5f0625f
......@@ -203,7 +203,7 @@ func main() {
r.PathPrefix("/").
Handler(http.FileServer(http.Dir(webrootDir)))
// DEBUG: add notfound handler
// DEBUG: add notfound handler
r.NotFoundHandler = http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
requestDump, err := httputil.DumpRequest(r, true)
if err != nil {
......
......@@ -209,10 +209,10 @@ func NeverMatch(c *SearchableCert) bool { return false }
// MakeInternalSearchFilter creates a SCFilter that based on a simple substring match
func MakeInternalSearchFilter(query string) SCFilter {
cleaned := CleanupQueryString(query)
// return zero results on empty query
if cleaned == "" {
// return zero results on empty query
if cleaned == "" {
return NeverMatch
}
}
// quote RE2-tokens
quoted := regexp.QuoteMeta(cleaned)
fullre := "(?:" + quoted + ")"
......@@ -446,10 +446,10 @@ func (c *SearchableCert) JSONResult(watchers map[int]*AttributeState) *JSONResul
CommonName: c.rawCertificate.Subject.CommonName,
OrganizationalUnit: strings.Join(c.rawCertificate.Subject.OrganizationalUnit, "/"),
KeyLength: c.KeyLength,
NotBeforeDuration: humanreltime.German.Duration(c.NotBefore, now, humanreltime.Years),
NotBeforeDuration: humanreltime.German.Duration(c.NotBefore, now, humanreltime.Years, 2),
NotBeforeDisplay: c.NotBefore.Format(time.RFC1123Z),
NotBeforeEpoch: c.NotBefore.Unix(),
NotAfterDuration: humanreltime.German.Duration(c.NotAfter, now, humanreltime.Years),
NotAfterDuration: humanreltime.German.Duration(c.NotAfter, now, humanreltime.Years, 2),
NotAfterDisplay: c.NotAfter.Format(time.RFC1123Z),
NotAfterEpoch: c.NotAfter.Unix(),
DNSNames: c.DNSNames,
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment