Add mime type in ExecuteResponse in runner service #549
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.
Mime type is sent in the first
ExecuteReponse
that contains any stdout; it is sent only once.This implementation is pretty native; it analyses the first read stdout chunk and tries to detect the mime type. If it's not found, then the stdout is sent and mime type is not detected again.
The alternative approach might be to buffer stdout and try to detect mime type multiple times until N bytes is read. If there is no result after N bytes, the detection is stopped. Still, the detected mime type should be sent only one per
Execute()
invocation, however, it could arrive later than in the firstExecuteResponse
.@sourishkrout My approach would be to test this approach against some real world examples. If we are not satisfied with the result, I can implement the alternative.
Closes #545