Skip to content

Commit 7559b66

Browse files
Merge remote-tracking branch 'origin/main' into yevhenii/proxy-v3
2 parents 1a5965a + 7d83c3e commit 7559b66

File tree

2 files changed

+1
-12
lines changed

2 files changed

+1
-12
lines changed

audit/log_auditor.go

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,6 @@ func NewLogAuditor(logger *slog.Logger) *LogAuditor {
1616

1717
// AuditRequest logs the request using structured logging
1818
func (a *LogAuditor) AuditRequest(req Request) {
19-
if req.Host == "localhost:8080" || req.Host == "127.0.0.1:8080" {
20-
return
21-
}
22-
2319
if req.Allowed {
2420
a.logger.Info("ALLOW",
2521
"method", req.Method,

proxy/proxy.go

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -183,8 +183,6 @@ func (p *Server) handleHTTPConnection(conn net.Conn) {
183183
// Check if request should be allowed
184184
result := p.ruleEngine.Evaluate(req.Method, req.Host)
185185

186-
//result.Allowed = true
187-
188186
// Audit the request
189187
p.auditor.AuditRequest(audit.Request{
190188
Method: req.Method,
@@ -236,8 +234,6 @@ func (p *Server) handleTLSConnection(conn net.Conn) {
236234
// Check if request should be allowed
237235
result := p.ruleEngine.Evaluate(req.Method, req.Host)
238236

239-
//result.Allowed = true
240-
241237
// Audit the request
242238
p.auditor.AuditRequest(audit.Request{
243239
Method: req.Method,
@@ -318,15 +314,12 @@ func (p *Server) forwardRequest(conn net.Conn, req *http.Request, https bool) {
318314
// Make request to destination
319315
resp, err := client.Do(newReq)
320316
if err != nil {
321-
if strings.Contains(newReq.Host, "localhost:8080") {
322-
return
323-
}
324-
325317
p.logger.Error("Failed to forward HTTPS request", "error", err)
326318
return
327319
}
328320

329321
p.logger.Debug("🔒 HTTPS Response", "status code", resp.StatusCode, "status", resp.Status)
322+
330323
p.logger.Debug("Forwarded Request",
331324
"method", newReq.Method,
332325
"host", newReq.Host,

0 commit comments

Comments
 (0)