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

Mountebank Imposter UI does not add imposters with Mountebank version 2.4.0 #12

Open
rgonzo opened this issue Apr 15, 2021 · 3 comments

Comments

@rgonzo
Copy link

rgonzo commented Apr 15, 2021

Mountebank Imposter UI does not add imposters with Mountebank version 2.4.0

  1. Start a mountebank server using mountebank 2.4.0
  2. Create an imposter in the Mountebank Imposter UI tool
  3. Select the Mountebank JSON tab and then select the "Submit to Mountebank" button
  4. Notice the error: Error: problem posting to Mountebank. Mountebank server may need --allow-CORS mode

Screen Shot 2021-04-14 at 11 07 23 PM
NOTE: --allow-CORS mode does not solve the problem and the issue is not present when using Mountebank version 2.2.1

Browser used was Chrome however, Firefox was also used and the problem was also encountered.
This issue was encountered on a macOS Big Sur and on a Windows 10 install.

This request results in an NS_DOM_BAD_URI error in the Firefox network inspector for the following request:

curl 'http://localhost:2525/imposters' \
  -H 'sec-ch-ua: "Google Chrome";v="89", "Chromium";v="89", ";Not A Brand";v="99"' \
  -H 'Accept: application/json, text/plain, */*' \
  -H 'Referer: ' \
  -H 'sec-ch-ua-mobile: ?0' \
  -H 'User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/89.0.4389.128 Safari/537.36' \
  -H 'Content-Type: application/json' \
  --data-raw $'{\n  "port": "3001",\n  "protocol": "http",\n  "stubs": [\n    {\n      "responses": [\n        {\n          "is": {\n            "statusCode": 200,\n            "body": "{}' \
  --compressed

NOTE: edited curl so it will not work

Screen Shot 2021-04-15 at 12 54 18 AM

@rgonzo
Copy link
Author

rgonzo commented Apr 15, 2021

Btw this UI tool is absolutely amazing!

@Ventzy
Copy link

Ventzy commented Jul 18, 2021

Add origin instead
mb --origin 'http://donhenton.github.io'

@rgonzo
Copy link
Author

rgonzo commented Aug 3, 2021

Add origin instead
mb --origin 'http://donhenton.github.io'

Running the specified command did not fix the issue. I am able to use the web tool with mountebank 2.2.1 but not 2.4.0.

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

2 participants