Add flamegraph path to response headers #601
Merged
+10
−3
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The motivation for this is to enable easy access to the flamegraph when using the async-flamegraph action. Currently, if you have a CURL request that you want to profile, you have to add the
pp=async-flamegraphquery parameter to the request, then copy the first ID from theX-MiniProfiler-Idsheader, then add that ID to the/mini-profiler-resources/flamegraph?id=path in the browser. This assumes that you know that the current request profile id is the first one in theX-MiniProfiler-Idsheader (personally, I was not confident of this until I read the source code) and that you know the path to the flamegraph endpoint.I originally added the protocol, host, and port to the path, but I didn't know if that was guaranteed to be correct in all cases, so I removed it. If anyone else has a preference for this, I would be happy to hear it!