Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BUGFIX: Update the duration extraction from the Server-Timing header #6

Merged
merged 1 commit into from
Jun 29, 2024

Conversation

akarasik
Copy link
Contributor

Recently the Server-Timing header value changed to:
cfRequestDuration;dur=74.000120, cfL4;desc="?proto=TCP,{rest_of_description_here}"

Therefore the split(';') will result in the following string: dur=74.000120, cfL4

When executing the next float(part.split('=')[1]) it will return 74.000120, cfL4 which cannot be transformed to a float.

This commit will try to extract it that way (in case the headers will change back), and if not - it will extract assuming the new format

Recently the Server-Timing header value changed to:
cfRequestDuration;dur=74.000120, cfL4;desc="?proto=TCP,{rest_of_description_here}"

Therefore the split(';') will result in the following string:
dur=74.000120, cfL4

When executing the next float(part.split('=')[1]) it will return
"74.000120, cfL4" which cannot be transformed to a float.

This commit will try to extract it that way (in case the headers will
change back), and if not - it will extract assuming the new format
@12932
Copy link
Owner

12932 commented Jun 29, 2024

Oh man what the hell is going on here, their server suddenly has two "server-timing" response headers with different capitalisation

@12932 12932 merged commit 991f816 into 12932:master Jun 29, 2024
5 checks passed
@akarasik akarasik deleted the bugfix/header_parsing branch June 30, 2024 06:48
@Cyberes Cyberes mentioned this pull request Jul 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants