microbiomedata / nmdc-runtime

Runtime system for NMDC data management and orchestration
https://microbiomedata.github.io/nmdc-runtime/
Other
4 stars 3 forks source link

Update analytics middleware to log requests lacking a `user-agent` header #516

Closed eecavanna closed 1 month ago

eecavanna commented 1 month ago

Description

The changes on this branch make it so the analytics middleware no longer raises a KeyError when the incoming request lacks a user-agent (case-insensitive) header.

If someone wants the runtime to deny those requests, I propose that be done elsewhere (and explicitly documented).

Fixes #515.

Type of change

How Has This Been Tested?

I confirmed, locally (shown here), that requests that lack a User-Agent header are now logged by the analytics middleware. I also confirmed that requests that have the header are also logged (as they were before).

Configuration Details: none

Checklist:

eecavanna commented 1 month ago

I will test this change locally now—to confirm putting a value of None in that property of the dictionary doesn't break anything downstream.

eecavanna commented 1 month ago

I confirmed, locally (shown here), that requests that lack a User-Agent header are now logged by the analytics middleware. I also confirmed that requests that have that header are also logged (as they were before).

image

eecavanna commented 1 month ago

Hi @shreddd, I finished testing this branch.