Skip to content

Commit

Permalink
wip: debugging prose filter and presidio
Browse files Browse the repository at this point in the history
  • Loading branch information
qlonik committed Apr 29, 2024
1 parent 86e5a89 commit d7160de
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
5 changes: 5 additions & 0 deletions presidio/server/server.py
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,11 @@ def http_exception(e):
@self.app.route("/batchanalyze", methods=["POST"])
def batch_analyze() -> Tuple[Response, int]:
"""Execute the batch analyzer function."""

print("Headers received as part of batchanalyze:")
for k, v in request.headers.items():
print(f"{k}: {v}")

# Parse the request params
try:
request_obj = request.get_json()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,14 @@ func PiiAnalysis(ctx context.Context, presidioSvcURL string, svcName string, buf
req.Header.Set("Content-Type", "application/json")
GlobalOtelPropagator.Inject(ctx, propagation.HeaderCarrier(req.Header))

fmt.Println("injected headers before sending to presidio:")
for k, v := range req.Header {
fmt.Printf(" %s:\n", k)
for _, vv := range v {
fmt.Printf(" %s\n", vv)
}
}

resp, err := http.DefaultClient.Do(req)
if err != nil {
return empty, fmt.Errorf("presidio post error: %w", err)
Expand Down

0 comments on commit d7160de

Please sign in to comment.