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

GET imposter(s) with replayable: true does not return allowCORS property #760

Open
teameh opened this issue Mar 29, 2024 · 0 comments · May be fixed by #761
Open

GET imposter(s) with replayable: true does not return allowCORS property #760

teameh opened this issue Mar 29, 2024 · 0 comments · May be fixed by #761

Comments

@teameh
Copy link
Contributor

teameh commented Mar 29, 2024

Expected behaviour

  • Creating an imposter with allowCORS: true
  • Getting the imposter with replayable: true
  • Imposter contains allowCORS: true

Note that https server metadata such as key , cert ,mutualAuth, etc. Are already returned because server.metadata is already added to the result. It's just that allowCORS is missing.

Actual behaviour

allowCORS field is missing

Steps to reproduce

PUT http://localhost:2525/imposters

{
  "imposters": [
    {
      "port": 1234,
      "protocol": "https",
      "allowCORS": true
    }
  ]
}

GET http://localhost:2525/imposters

{
  "imposters": [
    {
      "protocol": "http",
      "port": 1234,
      "recordRequests": false,
      "stubs": []
    }
  ]
}

Expected would be :

{
  "imposters": [
    {
      "protocol": "http",
      "port": 1234,
      "allowCORS" : true,
      "recordRequests": false,
      "stubs": []
    }
  ]
}

Software versions used

OS         : MacOS
mountebank : v2.9.1
node.js    : v16.20.2
Installation method : npm

Log contents in mb.log when running mb --loglevel debug

warn: [mb:2525] Running with --allowInjection set. See http://localhost:2525/docs/security for security info
info: [mb:2525] mountebank v2.9.1 now taking orders - point your browser to http://localhost:2525/ for help
debug: [mb:2525] config: {"options":{"allow-injection":true,"allowInjection":true,"local-only":true,"localOnly":true,"port":2525,"noParse":false,"no-parse":false,"formatter":"mountebank-formatters","pidfile":"mb.pid","ipWhitelist":["*"],"ip-whitelist":"*","mock":false,"debug":false,"protofile":"protocols.json","origin":false,"apikey":null,"log":{"level":"debug","transports":{"console":{"colorize":true,"format":"%level: %message"},"file":{"path":"mb.log","format":"json"}}}},"process":{"nodeVersion":"v16.20.2","architecture":"arm64","platform":"darwin"}}
info: [mb:2525] PUT /imposters
debug: [mb:2525] ::ffff:127.0.0.1:50003 => {"imposters":[{"port":1234,"protocol":"http","allowCORS":true}]}
info: [http:1234] Open for business...
info: [mb:2525] GET /imposters?replayable=true&removeProxies=false```


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

Successfully merging a pull request may close this issue.

1 participant