Adding Headers to Zuul when re-directing

后端 未结 3 1638
离开以前
离开以前 2021-01-18 07:49

I am trying to use Zuul to redirect calls to a downstream system somewhere else. In the re-direct, I need to add in a Header with necessary data for the

3条回答
  •  隐瞒了意图╮
    2021-01-18 07:54

    A little late my response but works fine
    As referred in the official documentation Cookies and Sensitive Headers
    The sensitiveHeaders are a blacklist, and the default is not empty. Consequently, to make Zuul send all headers (except the ignored ones), you must explicitly set it to the empty list. Doing so is necessary if you want to pass cookie or authorization headers to your back end. The following example shows how to use sensitiveHeaders:

    zuul:
      routes:
        entry:
          path: /users/**
          strip-prefix: false
          service-id: users-service
          sensitive-headers:
          - Cookie,Set-Cookie
    

    This implemented example can also help you

提交回复
热议问题