sheehan / grails-console

A web-based Groovy console for interactive runtime application management and debugging
Apache License 2.0
78 stars 41 forks source link

Mixed Content #36

Closed jglapa closed 9 years ago

jglapa commented 9 years ago

I'm getting the following exception when submitting an execute operation console v1.5.4 Grails v2.4.5

The app is deployed on Tomcat with Nginx acting as SSL Proxy. I suspect that the scheme is established on server side and it's http over there?

image

sheehan commented 9 years ago

Have you set grails.serverURL? See #26

jglapa commented 9 years ago

Yes, problably that's the problem I dont' have grails.serverURL property set. I don't really want to set it because my app is deployed on different domains, That would make my life complicated in terms of configuration.

Wouldn't it be easier to provide a protocol relative URL on client side? Something like:

'//'+ document.domain + '/console/execute'

This should work in all cases?

sheehan commented 9 years ago

That won't work if the application has a context path. I can probably check the window.location.protocol though and make sure we're using the same one. I'll take a look.

jglapa commented 9 years ago

you can check for contextPath in request object: '//'+ document.domain + ${request.contextPath ?:'/'} + 'console/execute' altough if it's behind a reverse proxy that hides the context path it will be no use

sheehan commented 9 years ago

@jglapa this should be fixed now in the latest. See https://github.com/sheehan/grails-console/blob/e5e92cb2c6b2edc68d5a49b5d741e2198997979a/web/app/app.coffee#L12