bug: fix not overrideing Server-Timing if it exists in header already#2303
Conversation
Coverage reportClick to see where and how coverage changed
This report was generated by python-coverage-comment-action |
||||||||||||||||||||||||
tim-schilling
left a comment
There was a problem hiding this comment.
Ah, actually @JohananOppongAmoateng we should note this in the change log as per the PR template. I think this is valuable to mention.
|
@tim-schilling added it |
tim-schilling
left a comment
There was a problem hiding this comment.
Looking at this again, it looks like we're always going to append to the header with this structure. I'm not sure we want to do that in all cases. For example, in HistoryPanel.get_headers() it's trying to set the request id. If it's already been set, we wouldn't want to append. We'd want to either leave it alone or overwrite it entirely.
Do you have any ideas on how to make this more reusable?
|
the problem is how do you determine what to override or what to leave |
|
I can try to come up with something, but it may be a bit. If you'd like to propose something, that may be faster. We can iterate on things too, it doesn't need to be perfect in the first attempt. |
|
@JohananOppongAmoateng so I think one way is to have two different ways for a panel to set a header in the response. An update collection (overrides the value) and an append collection (adds to the values). See 3d40ff7 for the actual code. This was a first attempt, but the tests pass. We probably need to clean it up and rework our documentation to use it, if we want to. |
i think that would work |
Description
Fix middleware overriding server timing header
Fixes #2300
Checklist:
docs/changes.rst.AI/LLM Usage