v0.5.1 minor basic auth bug fixes, dependency udpate, test scripts are being added
This commit is contained in:
@ -225,6 +225,7 @@ func (h *HTTPSink) Start(ctx context.Context) error {
|
||||
fasthttpLogger := compat.NewFastHTTPAdapter(h.logger)
|
||||
|
||||
h.server = &fasthttp.Server{
|
||||
Name: fmt.Sprintf("LogWisp/%s", version.Short()),
|
||||
Handler: h.requestHandler,
|
||||
DisableKeepalive: false,
|
||||
StreamRequestBody: true,
|
||||
|
||||
@ -8,8 +8,6 @@ import (
|
||||
"crypto/x509"
|
||||
"encoding/base64"
|
||||
"fmt"
|
||||
"logwisp/src/internal/auth"
|
||||
"logwisp/src/internal/config"
|
||||
"net/url"
|
||||
"os"
|
||||
"strings"
|
||||
@ -17,8 +15,11 @@ import (
|
||||
"sync/atomic"
|
||||
"time"
|
||||
|
||||
"logwisp/src/internal/auth"
|
||||
"logwisp/src/internal/config"
|
||||
"logwisp/src/internal/core"
|
||||
"logwisp/src/internal/format"
|
||||
"logwisp/src/internal/version"
|
||||
|
||||
"github.com/lixenwraith/log"
|
||||
"github.com/valyala/fasthttp"
|
||||
@ -441,6 +442,8 @@ func (h *HTTPClientSink) sendBatch(batch []core.LogEntry) {
|
||||
req.Header.SetContentType("application/json")
|
||||
req.SetBody(body)
|
||||
|
||||
req.Header.Set("User-Agent", fmt.Sprintf("LogWisp/%s", version.Short()))
|
||||
|
||||
// Add Basic Auth header if credentials configured
|
||||
if h.config.Username != "" && h.config.Password != "" {
|
||||
creds := h.config.Username + ":" + h.config.Password
|
||||
|
||||
Reference in New Issue
Block a user