mountebank-UI icon indicating copy to clipboard operation
mountebank-UI copied to clipboard

Mountebank Imposter UI does not add imposters with Mountebank version 2.4.0

Open rgonzo opened this issue 3 years ago • 3 comments

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 avatar Apr 15 '21 06:04 rgonzo