bananaml / potassium

An HTTP serving framework by Banana
Apache License 2.0
97 stars 9 forks source link

Add request ID into request, and include headers #46

Closed erik-dunteman closed 9 months ago

erik-dunteman commented 9 months ago

What is this?

potassium Requests now have these fields: .id - the request ID from Banana, sent as "X-Banana-Request-Id" in headers .headers - the headers from the original request

Why?

.id is needed so users can include the request.id in their logs for filtering in Banana .headers is needed because we're an important http framework 💪

How did you test it works without regressions?

Tests pass, added new tests.

If this is a new feature what may a critical error look like?

Headers, depending on the http client sending them, may have their cases changed, so the assumption is that users test their code before using this

Things to consider to not repeat mistakes we've learned from many times

ErikKaum commented 9 months ago

lgtm!

erik-dunteman commented 9 months ago

I've decided to not cast the headers to a dict, instead am keeping it as EnvironHeaders to preserve the case insensitivity.