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

Output file always empty #173

Open
xLinkOut opened this issue Jul 31, 2024 · 3 comments
Open

Output file always empty #173

xLinkOut opened this issue Jul 31, 2024 · 3 comments

Comments

@xLinkOut
Copy link

Hi, I'm using the mitmproxy2swagger 0.13.0 and mitmproxy 10.4.1, with Python 3.12.4. I'm currently excperience the following scenario:

  • Save mitmproxy flow to a pb.flow file (tested with either mitmproxy, mitmweb and mitmdump)
  • Run the following mitmproxy2swagger -i pb.flow -o pb.out -p https://<domain> -f flow --examples --headers, where I'm sure that requests to are in the flow file
  • The generated output does not contain any URLs, like:
openapi: 3.0.0
info:
  title: pb.flow Mitmproxy2Swagger
  version: 1.0.0
servers:
- url: https://<domain>
  description: The default server
paths: {}
x-path-templates:
# Remove the ignore: prefix to generate an endpoint with its URL
# Lines that are closer to the top take precedence, the matching is greedy
- ignore:/

Even if I delete the - ignore:/ and re-run the command, nothing change. If, in the first run, I set -p "" (as suggested in #29), in the output file there is a list of all domains from the flow file, but subsequently run of the same command, after remove the ignore for the domain of interest, produce the same output.

I've tried a lot of combinations (quote or not quote the api-prefix, save the flow with all mitmproxy suite, and so on). There is something I'm doing wrong? Thank you.

@alufers
Copy link
Owner

alufers commented Aug 1, 2024

Hmm it's hard to tell what's wrong from the description. Maybe you are using http instead of https://?

If you can you can upload the flow file and I could see what's wrong. Otherwise try capturing some traffic to some public API for example here: https://httpbin.org/ and then check extracting the api endpoints or upload the flow file.

@xLinkOut
Copy link
Author

xLinkOut commented Aug 1, 2024

Thanks for your reply. The protocol is correct, and I've already tried to use both (just in case). I'll upload here httpbin.flow.zip where, instead, I observe a different behaviour: even if I correctly see the endpoint into the first output, after deleting the ignore lines, the second run does not generate the expected output.

httpbin.flow.zip

@jjgit1234
Copy link

jjgit1234 commented Oct 27, 2024

Issue same as in #177

Similar issue was fixed in #110

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants