Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
KIT-CA
websearch
Commits
1c47f3d2
Commit
1c47f3d2
authored
Apr 21, 2017
by
Heiko Reese
Browse files
m…
parent
a5f0625f
Changes
2
Hide whitespace changes
Inline
Side-by-side
ca-websearch/daemon.go
View file @
1c47f3d2
...
...
@@ -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
{
...
...
searchablecert.go
View file @
1c47f3d2
...
...
@@ -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
,
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment