service mesh的linkerd的postman测试问题

测试linkerd的服务时使用postman会出错,解析不到正确的host
协议是http,curl,java用unirest模拟http(和postman相同的参数,代码也是postman生成的)都行,就是postman不行(No hosts are available for /svc/localhost:4140)

public static void main(String[] args) throws  Exception{
        HttpResponse<String> response = Unirest.get("http://localhost:4140/")
                .header("GET", "/6767 HTTP/1.1")
                .header("cache-control", "no-cache")
                .header("host", "web")
                .header("postman-token", "4def4acc-61ad-d443-9ce5-52a3df3db501")
                .asString();

        System.out.println(response.getBody());
    }
curl -H "Host: web" http://localhost:4140/

后来google发现,原理是postman会屏蔽一些header的修改,在get时,设置header(Host:web)没有起作用。需要安装postman interceptor或者打开postman interceptor开关,这时设置的header才能起作用
查找结果:
Override the ‘Host’ header #781
Interceptor extension 下面Restricted Headers
postman interceptor开关

enjoy service mesh!

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值