Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
caddy
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
caddy
Commits
676202a3
Commit
676202a3
authored
8 years ago
by
Carter
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed styling and byte count
parent
8e8e2f59
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
5 deletions
+4
-5
caddyhttp/httpserver/replacer.go
caddyhttp/httpserver/replacer.go
+4
-5
No files found.
caddyhttp/httpserver/replacer.go
View file @
676202a3
...
...
@@ -147,17 +147,16 @@ func NewReplacer(r *http.Request, rr *ResponseRecorder, emptyValue string) Repla
return
rep
}
func
canLogRequest
(
r
*
http
.
Request
)
(
canLog
bool
)
{
func
canLogRequest
(
r
*
http
.
Request
)
bool
{
if
r
.
Method
==
"POST"
||
r
.
Method
==
"PUT"
{
for
_
,
cType
:=
range
r
.
Header
[
headerContentType
]
{
// the cType could have charset and other info
if
strings
.
Index
(
cType
,
contentTypeJSON
)
>
-
1
||
strings
.
Index
(
cType
,
contentTypeXML
)
>
-
1
{
canLog
=
true
break
return
true
}
}
}
return
return
false
}
// readRequestBody reads the request body and sets a
...
...
@@ -280,5 +279,5 @@ const (
headerContentType
=
"Content-Type"
contentTypeJSON
=
"application/json"
contentTypeXML
=
"application/xml"
maxLogBodySize
=
100
*
10
00
maxLogBodySize
=
100
*
10
24
)
This diff is collapsed.
Click to expand it.
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