I’m xwiki 9.11.4 and getUrlContentAsBytes. If I set http.proxyHost and http.proxyPort on the command line of tomcat everything is sent over to the proxy regardless of the configuration of http.nonProxyHosts.
I have other Java Web apps where I also set http.nonProxyHosts in tomcat, so I’m fairly confident that my config is right. Can anybody confirm this or even better has a working config? Maybe I’m missing something special for xwiki?
Indeed as far as I can see getUrlContentAsBytes is using an old HTTPClient version plus instead of letting it get the standard configuration it more or less do it itself. It would really worth some refactoring, don’t hesitate to create a BUG issue on Loading....
@tmortagne: thanks for the analysis. I will file a bug report this evening.
@vmassol: Thank you for the work around, will try this later.
It’s good to have a workaround, it would be better to have it fixed and the best would be to have it refactored so that it returns an “object” with maybe httpStatus and data properties. That would fix the “issue” on the other thread too.
have it refactored so that it returns an “object” with maybe httpStatus and data properties
Unfortunately this would be an API breakage. Also frankly this API is not very good and a new HTTPClient-like script service or Velocity tool would be much better.