0
votes

Please take a look at scenario I've writen here: https://github.com/jroquelaure/jfrog-vso-extension/issues/3 is there any workaround?

1
I could reproduce your issue on both TFS and VSTS, this maybe a bug on JFrog Artifactory side. You could also try to contact their support directly jfrog.com/contact-us - PatrickLu-MSFT

1 Answers

1
votes

This page uses Ajax to call the REST API and display the build info, therefore, you have to enable CORS requests on the reverse proxy or tomcat of your Artifactory server.

To enable it in your tomcat, add the following to $TOMCAT_HOME/webapps/artifactory/WEB-INF/web.xml:

<filter>
  <filter-name>CorsFilter</filter-name>
  <filter-class>org.apache.catalina.filters.CorsFilter</filter-class>
  <init-param>
    <param-name>cors.allowed.origins</param-name>
    <param-value>*</param-value>
  </init-param>
  <init-param>
    <param-name>cors.allowed.methods</param-name>
    <param-value>GET,POST,OPTIONS,PUT,DELETE</param-value>
  </init-param>
  <init-param>
    <param-name>cors.allowed.headers</param-name>
    <param-value>Content-Type,accept,Origin,Authorization</param-value>
  </init-param>
  <init-param>
    <param-name>cors.exposed.headers</param-name>
    <param-value>Access-Control-Allow-Origin,Access-Control-Allow-Credentials</param-value>
  </init-param>
  <init-param>
    <param-name>cors.support.credentials</param-name>
    <param-value>true</param-value>
  </init-param>
  <init-param>
    <param-name>cors.preflight.maxage</param-name>
    <param-value>10</param-value>
  </init-param>
</filter>

<filter-mapping>
  <filter-name>CorsFilter</filter-name>
  <url-pattern>/*</url-pattern>
</filter-mapping>