Springfox Swagger 使用端口 80 为 HTTPS URL 生成请求 [英] Springfox Swagger generating requests with port 80 for HTTPS URLS

查看:26
本文介绍了Springfox Swagger 使用端口 80 为 HTTPS URL 生成请求的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

I am experiencing an issue using springfox-swagger2 v2.2.0 related to the request padding port 80 for a HTTP URL.

Is there anyway to disable the generation of the port or set the port to 443 programmatically based on a Spring Profile?

Generated CURL:

curl -X GET --header "Accept: application/json" "https://test.com:80/api/users/search"

解决方案

I had the same issue. It is because Swagger uses a class from Spring Framework which is adding the port 80 to the host property in the /v2/api-docs json response (Check Swagger2Controller.class). I had this issue with spring framework version 4.1.4.Release. Upgrading to latest version 4.3.2.Release fixed it.

这篇关于Springfox Swagger 使用端口 80 为 HTTPS URL 生成请求的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆