alexkvak / teamcity-slack

TeamCity Slack plugin
MIT License
124 stars 23 forks source link

Response for preflight is invalid (redirect) #35

Closed heaven closed 6 years ago

heaven commented 6 years ago

Receiving this error when opening the tab:

screen shot 2018-06-14 at 20 33 35

TeamCity Professional 2017.2.2 (build 50909) Slack Integration 1.1.7

alexkvak commented 6 years ago

Please show your location bar

heaven commented 6 years ago

Hi, here's the value: http://teamcity.wegohealth.com/viewType.html?buildTypeId=Carmen_Default&tab=Slack&branch_Carmen=__all_branches__

alexkvak commented 6 years ago

Location is ok. Could you provide full redirect response?

heaven commented 6 years ago

It seems the cause was that it uses HTTPS while the page is loaded using HTTP.

Just loaded the page over HTTPS and that worked. I think the plugin should use the same protocol as the page.

alexkvak commented 6 years ago

So your TeamCity works via HTTP and via HTTPS at same time?

alexkvak commented 6 years ago

Please check the setting Server URL on Administration - Global Settings page

heaven commented 6 years ago

Yup. I think we did not configure the redirect to force SSL but this is not mandatory. Since we can load the page over HTTP the plugin has to use the same protocol (or use a protocol-relative URL //teamcity.wegohealth.com/...).

heaven commented 6 years ago

Please check the setting Server URL on Administration - Global Settings page

Correct, we had https:// there. This fixed the problem but I am wondering why didn't this break other functionality.

alexkvak commented 6 years ago

It seems that plugin should construct relative path, and not it constructs full URL. There was an issue when TeamCity was served not in root but in "subfolder" e.g. http://my.com/teamcity/ I make some investigations and try to fix this. Thanks for report.