yapi icon indicating copy to clipboard operation
yapi copied to clipboard

mock数组中添加url或者domain导致服务挂起【必现】

Open tonypig opened this issue 7 years ago • 2 comments

版本号

1.7.1

什么问题

点击mock接口链接后服务挂起

如何复现此问题

image mock数组中填写http://www.baidu.com或者www.baidu.com, 访问mock接口链接后服务挂起

什么浏览器

chrome

什么系统(Linux, Windows, macOS)

macOS、Windows

tonypig avatar Jul 12 '19 09:07 tonypig

我尝试重现你的情况,但是得到了正常的响应: image

我的Request和Response设置如下

{
  "type": "object",
  "properties": {
    "items": {
      "type": "object",
      "properties": {
        "name": {
          "type": "string",
          "mock": {
            "mock": "a string"
          }
        },
        "guid": {
          "type": "string",
          "mock": {
            "mock": "@guid"
          }
        },
        "img_url": {
          "type": "string",
          "mock": {
            "mock": "http://www.baidu.com"
          }
        },
        "other_img_url": {
          "type": "string",
          "mock": {
            "mock": "www.baidu.com"
          }
        }
      },
      "required": [
        "name",
        "img_url",
        "other_img_url",
        "guid"
      ]
    }
  },
  "required": [
    "items"
  ]
}

如果需要的话,请提供你的Request和Response设置,我会在晚些时候尝试重现此问题。

tangcent avatar Jul 14 '19 06:07 tangcent

image 按在这个配置再试试呢

tonypig avatar Jul 22 '19 09:07 tonypig