Kong / insomnia

The open-source, cross-platform API client for GraphQL, REST, WebSockets, SSE and gRPC. With Cloud, Local and Git storage.
https://insomnia.rest
Apache License 2.0
35.06k stars 1.99k forks source link

[Bug] Visual Preview doesn't refresh when requesting an audio file with different Range header values #890

Closed b0o closed 6 years ago

b0o commented 6 years ago

Insomnia Version:

Version 5.15.0
Shell 1.7.13
Node 7.9.0

Operating System: Arch Linux (Linux 4.15.15-1-ARCH x86_64 GNU/Linux)

Details

I'm attempting to properly implement RFC 7233 (HTTP/1.1 Range Requests) in my server application.

A very useful way for me to develop to spec is to study and reference the behavior of other existing implementations, e.g. Nginx or Apache.

A somewhat annoying bug in Insomnia is that the response Visual Preview sometimes isn't updated when I change some header parameters like the Range field. I have to click the dropdown on the Preview tab and switch to another preview type and then switch back to Visual in order for the preview to update.

Here's an example request you can try to reproduce this bug:

curl --request GET \
  --url https://ia600201.us.archive.org/28/items/ToneTest_74/tone.mp3 \
  --header 'range: bytes=0-'
  1. Execute the request once. The preview should show an HTML5 Audio element which you can use to listen to the audio file. Listening to it, you should hear a tone which lasts for 5 seconds.

  2. Try changing the Range header to a different value: bytes=0-20000. This requests only the first 20KB of the audio file from the server. The HTML Audio element in the preview window won't update to reflect the new response. Playing the audio element, you should still hear the same tone lasting 5 seconds.

  3. Try changing the preview type from Visual to Raw and back to Visual. Now play the audio element and you should hear a tone which only lasts approximately 2 seconds before being cut off.

The expected behavior would be for the Visual Preview to update immediately upon a change in the response data.

welcome[bot] commented 6 years ago

šŸ‘‹ Thanks for opening your first issue! If you're reporting a šŸž bug, please make sure you include steps to reproduce it. If you're requesting a feature šŸŽ, please provide real use cases that would benefit. šŸ‘Ŗ

To help make this a smooth process, please be sure you have first read the contributing guidelines.

gschier commented 6 years ago

Oops, that was a silly mistake. Fixed šŸ˜„