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

Importing Insomnia collection containing application/xml requests does not import XML body #3106

Closed
2 tasks done
ryanbennitt opened this issue Sep 15, 2024 · 4 comments
Closed
2 tasks done
Labels
bug Something isn't working

Comments

@ryanbennitt
Copy link

ryanbennitt commented Sep 15, 2024

I have checked the following:

  • I use the newest version of bruno.
  • I've searched existing issues and found nothing related to my issue.

Describe the bug

If you export a collection from Insomnia containing requests with application/xml content-type, when you try to import it into Bruno it does not import any of the XML bodies, just their basic details (name, URL, content-type).

The line at fault in packages/bruno-app/src/utils/importers/insomnia-collection.js (177) is:

} else if (mimeType === 'text/xml') {

This needs to check for application/xml as well.

.bru file to reproduce the bug

Insomnia export:

{"_type":"export","__export_format":4,"__export_date":"2024-09-15T20:18:00.106Z","__export_source":"insomnia.desktop.app:v2020.4.2","resources":[{"_id":"req_58601e7a56fe48c39b740bcf3ecf07d3","parentId":"wrk_fd44b3f6bd4a4e94a74d435418625803","modified":1726431071510,"created":1726431011741,"url":"http://localhost:8080/test","name":"Test Application Xml","description":"","method":"POST","body":{"mimeType":"application/xml","text":"\n\t\n\t\txml\n\t\n"},"parameters":[],"headers":[{"name":"Content-Type","value":"application/xml","id":"pair_441915d1ad4d4e2b80383e6fcdba4d04"}],"authentication":{},"metaSortKey":-1726431011741,"isPrivate":false,"settingStoreCookies":true,"settingSendCookies":true,"settingDisableRenderRequestBody":false,"settingEncodeUrl":true,"settingRebuildPath":true,"settingFollowRedirects":"global","_type":"request"},{"_id":"wrk_fd44b3f6bd4a4e94a74d435418625803","parentId":null,"modified":1605537859452,"created":1605537859452,"name":"Insomnia","description":"","scope":null,"_type":"workspace"},{"_id":"env_22f3b9571b34a43ba4da1001b7904384cc65f122","parentId":"wrk_fd44b3f6bd4a4e94a74d435418625803","modified":1605537859538,"created":1605537859538,"name":"Base Environment","data":{},"dataPropertyOrder":null,"color":null,"isPrivate":false,"metaSortKey":1605537859538,"_type":"environment"},{"_id":"jar_22f3b9571b34a43ba4da1001b7904384cc65f122","parentId":"wrk_fd44b3f6bd4a4e94a74d435418625803","modified":1605537859543,"created":1605537859543,"name":"Default Jar","cookies":[],"_type":"cookie_jar"},{"_id":"spc_ced55d0d913b42a0a4e9ee0a60ae01d1","parentId":"wrk_fd44b3f6bd4a4e94a74d435418625803","modified":1605537859455,"created":1605537859455,"fileName":"Insomnia","contents":"","contentType":"yaml","_type":"api_spec"}]}

Imported .bru file:

meta {
name: Test Application Xml
type: http
seq: 1
}

post {
url: http://localhost:8080/test
body: none
auth: none
}

headers {
Content-Type: application/xml
}

Screenshots/Live demo link

TestApplicationXml
@ryanbennitt ryanbennitt added the bug Something isn't working label Sep 15, 2024
@itsarijitray
Copy link
Contributor

@ryanbennitt Can I give this a shot?

@helloanoop
Copy link
Contributor

Go ahead @ryanbennitt !

@itsarijitray
Copy link
Contributor

Raised a small PR @ryanbennitt @helloanoop

PR: #3168

@helloanoop
Copy link
Contributor

PR Merged. This will be available in the upcoming v1.31.0 release.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants