You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@servicecomb.apache.org by GitBox <gi...@apache.org> on 2020/02/18 03:53:55 UTC

[GitHub] [servicecomb-java-chassis] SheldonDemo opened a new issue #1581: 使用zuul网关进行http代理对接servicecomb,在http请求中添加header报错

SheldonDemo opened a new issue #1581: 使用zuul网关进行http代理对接servicecomb,在http请求中添加header报错
URL: https://github.com/apache/servicecomb-java-chassis/issues/1581
 
 
   使用Zuul网关进行代理,把前台编译出的静态文件放入resources/static目录下,发现带有Authorization header的http请求报错:
   `CommonExceptionData [message=Parameter is not valid for operation [user-mgmt-be.user-mgmt-be.getUser]. Parameter is [Authorization]. Processor is [header].]`
   
   zuul网关代码:
   `@SpringBootApplication`
   `@EnableZuulProxy`
   `@EnableServiceComb`
   `public class GatewayApplication {`
   `public static void main(String[] args) {`
   `    SpringApplication.run(GatewayApplication.class, args);`
   `  }`
   `}`
   前台axios调用代码:
   `url = '/user-mgmt-be/v1/users/' + res.data.userId`
   `            axios({`
   `              method: 'GET',`
   `              url: url,`
   `              headers: {`
   `                'Authorization': 'Basic ' + res.data.token,`
   `                'Content-Type': 'application/json'`
   `              }`
   `            })`

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [servicecomb-java-chassis] SheldonDemo commented on issue #1581: 使用zuul网关进行http代理对接servicecomb,在http请求中添加header报错

Posted by GitBox <gi...@apache.org>.
SheldonDemo commented on issue #1581: 使用zuul网关进行http代理对接servicecomb,在http请求中添加header报错
URL: https://github.com/apache/servicecomb-java-chassis/issues/1581#issuecomment-588012030
 
 
   > You can first debug `RestCodec` to find the actual resons for the codec error. For security reasons, the exception is not printed by default.
   I can't debug  common-rest-1.3.0.jar...
   

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [servicecomb-java-chassis] SheldonDemo commented on issue #1581: 使用zuul网关进行http代理对接servicecomb,在http请求中添加header报错

Posted by GitBox <gi...@apache.org>.
SheldonDemo commented on issue #1581: 使用zuul网关进行http代理对接servicecomb,在http请求中添加header报错
URL: https://github.com/apache/servicecomb-java-chassis/issues/1581#issuecomment-587382619
 
 
   > You can first debug `RestCodec` to find the actual resons for the codec error. For security reasons, the exception is not printed by default
   

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [servicecomb-java-chassis] SheldonDemo removed a comment on issue #1581: 使用zuul网关进行http代理对接servicecomb,在http请求中添加header报错

Posted by GitBox <gi...@apache.org>.
SheldonDemo removed a comment on issue #1581: 使用zuul网关进行http代理对接servicecomb,在http请求中添加header报错
URL: https://github.com/apache/servicecomb-java-chassis/issues/1581#issuecomment-587382619
 
 
   > You can first debug `RestCodec` to find the actual resons for the codec error. For security reasons, the exception is not printed by default
   

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [servicecomb-java-chassis] SheldonDemo opened a new issue #1581: 使用zuul网关进行http代理对接servicecomb,在http请求中添加header报错

Posted by GitBox <gi...@apache.org>.
SheldonDemo opened a new issue #1581: 使用zuul网关进行http代理对接servicecomb,在http请求中添加header报错
URL: https://github.com/apache/servicecomb-java-chassis/issues/1581
 
 
   使用Zuul网关进行代理,把前台编译出的静态文件放入resources/static目录下,发现带有Authorization header的http请求报错:
   `CommonExceptionData [message=Parameter is not valid for operation [user-mgmt-be.user-mgmt-be.getUser]. Parameter is [Authorization]. Processor is [header].]`
   不带header的请求调用正常。
   
   zuul网关代码:
   `@SpringBootApplication`
   `@EnableZuulProxy`
   `@EnableServiceComb`
   `public class GatewayApplication {`
   `public static void main(String[] args) {`
   `    SpringApplication.run(GatewayApplication.class, args);`
   `  }`
   `}`
   前台axios调用代码:
   `url = '/user-mgmt-be/v1/users/' + res.data.userId`
   `            axios({`
   `              method: 'GET',`
   `              url: url,`
   `              headers: {`
   `                'Authorization': 'Basic ' + res.data.token,`
   `                'Content-Type': 'application/json'`
   `              }`
   `            })`

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [servicecomb-java-chassis] SheldonDemo closed issue #1581: 使用zuul网关进行http代理对接servicecomb,在http请求中添加header报错

Posted by GitBox <gi...@apache.org>.
SheldonDemo closed issue #1581: 使用zuul网关进行http代理对接servicecomb,在http请求中添加header报错
URL: https://github.com/apache/servicecomb-java-chassis/issues/1581
 
 
   

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [servicecomb-java-chassis] liubao68 commented on issue #1581: 使用zuul网关进行http代理对接servicecomb,在http请求中添加header报错

Posted by GitBox <gi...@apache.org>.
liubao68 commented on issue #1581: 使用zuul网关进行http代理对接servicecomb,在http请求中添加header报错
URL: https://github.com/apache/servicecomb-java-chassis/issues/1581#issuecomment-587301468
 
 
   You can first debug `RestCodec` to find the actual resons for the codec error.  For security reasons, the exception is not printed by default. 

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services