打开 WebSocket 连接时有没有办法使用自定义标头? [英] Is there a way to use custom headers when opening WebSocket connection?
问题描述
我正在尝试使用默认的 karate.webSocket(url, handler)
建立 WSS 连接;连接成功,但在将连接从 https
升级到 wss
时,所需的主机需要 Authorization: Bearer XXX
标头是否可以从 *.feature
文件中为 WebSocket 连接提供自定义 HTTP 标头?
I'm trying to make a WSS connection using default karate.webSocket(url, handler)
;
Connection is successful, but desired host requires Authorization: Bearer XXX
header when upgrading connection from https
to wss
Is it possible to provide custom HTTP headers from *.feature
file for WebSocket connection?
推荐答案
实际上没有,直到现在我们才意识到这是必要的.我们打开了一个问题:https://github.com/intuit/karate/issues/775 - 希望我们可以指望您对此进行测试.
Actually no, we never realized this was needed until now. We've opened an issue: https://github.com/intuit/karate/issues/775 - hope we can count on you to test this.
这篇关于打开 WebSocket 连接时有没有办法使用自定义标头?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!