launchiamenterprise / keyrunner

KeyRunner: A secure, codeless VS Code extension for API testing & Designing. Features include data encryption at rest, sensitive data masking, and the innovative Playground for chaining API requests without coding
https://keyrunner.app
MIT License
15 stars 1 forks source link

Content-Type header not being set correctly #26

Closed hex2bit closed 4 months ago

hex2bit commented 4 months ago

I have a pretty simple API request setup that does a POST to an API endpoint with some JSON data in the body. It looks like KeyRunner by default sends a Content-Type of "text/plain". I tried adding the Content-Type header as "application/json" and it looks to still just pass "text/plain", ignoring the header value I have set.

It would be nice if the app could detect that content type by investigating the body content. It could be as simple as looking for starting and ending curly brackets.

hex2bit commented 4 months ago

I am also noticing with XML based calls, it's doing the same kind of thing, but forcing the "application/xml" content type, regardless of what's set for Headers. The interesting thing is the example code snipets don't behave that way and do use the specified content type from the headers tab and those work (curl for example).

launchiamenterprise commented 4 months ago

@hex2bit can you share a screenshot of this behavior ? As we are not seeing this issue on our end.

launchiamenterprise commented 4 months ago

@hex2bit We've fixed the issue where KeyRunner was defaulting to "text/plain" for Content-Type headers. The app now correctly sets the Content-Type based on the request body/payload. Please update to the latest version-v1.0.56 and let us know if you encounter any further issues.

hex2bit commented 4 months ago

Looks like the download for the app is still 1.0.52 on the website, so I'll let you know once that's been updated and I can test the v1.0.56 version.

launchiamenterprise commented 4 months ago

@hex2bit App will automatically install new updates. If not, can you try clicking on check for updates and it should update to v1.0.56

image
hex2bit commented 4 months ago

I was looking at the website: image

And the app says I'm up to date while on v1.0.52 image

launchiamenterprise commented 4 months ago

when you click on "About" under KeyRunner menu does it say version 10.0.56? Can you try closing and reopening the app ?

image
hex2bit commented 4 months ago

Yep, it says 1.0.56, and I am seeing a different behavior now in my API calls vs. earlier in the morning when I was verifying after installing the version from the website download (which is a little behind). Looks like it auto-updated after closing/re-opening.

FYI, the About box wouldn't show up until I restarted the app if I click on Check for updates first.

The content type seems to be fixed now, but there's a couple other issues I'm noticing. One is that the content length is being passed as zero when using the text/xml content type. And in a JSON request I have, there's some other issue I haven't figured out yet, although that one does calculate the content length in the request. In both cases, using one of the Code Snippets the app provides, like a simple CURL, work fine without issue. I'll need to track down what's different about the requests the app is sending. I could open separate issues for those if you wish.

launchiamenterprise commented 4 months ago

@hex2bit Thanks for confirming . Please do open separate issues and we will fix those ASAP once we identify the issue. It would be great if you can provide us with sample requests with which we can reproduce the issue.

Closing this issue for now.