Merge pull request #868 from aledbf/lint

Lint nginx code
This commit is contained in:
Manuel Alejandro de Brito Fontes 2017-06-15 00:16:05 -04:00 committed by GitHub
commit c6b5335754
4 changed files with 3 additions and 8 deletions

View file

@ -165,9 +165,6 @@ type NGINXController struct {
cmdArgs []string cmdArgs []string
watchClass string
namespace string
stats *statsCollector stats *statsCollector
statusModule statusModule statusModule statusModule

View file

@ -177,7 +177,7 @@ type Configuration struct {
// Enable json escaping // Enable json escaping
// http://nginx.org/en/docs/http/ngx_http_log_module.html#log_format // http://nginx.org/en/docs/http/ngx_http_log_module.html#log_format
LogFormatEscapeJson bool `json:"log-format-escape-json,omitempty"` LogFormatEscapeJSON bool `json:"log-format-escape-json,omitempty"`
// Customize upstream log_format // Customize upstream log_format
// http://nginx.org/en/docs/http/ngx_http_log_module.html#log_format // http://nginx.org/en/docs/http/ngx_http_log_module.html#log_format
@ -315,7 +315,7 @@ func NewDefault() Configuration {
KeepAlive: 75, KeepAlive: 75,
KeepAliveRequests: 100, KeepAliveRequests: 100,
LargeClientHeaderBuffers: "4 8k", LargeClientHeaderBuffers: "4 8k",
LogFormatEscapeJson: false, LogFormatEscapeJSON: false,
LogFormatStream: logFormatStream, LogFormatStream: logFormatStream,
LogFormatUpstream: logFormatUpstream, LogFormatUpstream: logFormatUpstream,
MaxWorkerConnections: 16384, MaxWorkerConnections: 16384,

View file

@ -24,7 +24,6 @@ import (
"net" "net"
"os" "os"
"os/exec" "os/exec"
"regexp"
"strings" "strings"
text_template "text/template" text_template "text/template"
@ -392,7 +391,6 @@ func isLocationAllowed(input interface{}) bool {
} }
var ( var (
nonAlpha = regexp.MustCompile("[^a-zA-Z0-9]+")
denyPathSlugMap = map[string]string{} denyPathSlugMap = map[string]string{}
) )

View file

@ -93,7 +93,7 @@ http {
# disable warnings # disable warnings
uninitialized_variable_warn off; uninitialized_variable_warn off;
log_format upstreaminfo {{ if $cfg.LogFormatEscapeJson }}escape=json {{ end }}'{{ buildLogFormatUpstream $cfg }}'; log_format upstreaminfo {{ if $cfg.LogFormatEscapeJSON }}escape=json {{ end }}'{{ buildLogFormatUpstream $cfg }}';
{{/* map urls that should not appear in access.log */}} {{/* map urls that should not appear in access.log */}}
{{/* http://nginx.org/en/docs/http/ngx_http_log_module.html#access_log */}} {{/* http://nginx.org/en/docs/http/ngx_http_log_module.html#access_log */}}