Hi, I'm having trouble with https and my CSS: I ba...
# ktor
k
Hi, I'm having trouble with https and my CSS: I basically used what's shown in kotr-samples
Copy code
head {
    styleLink(url(MainCss))
}
And for my style definition:
Copy code
@Location("/styles/main.css")
object MainCss

fun Route.styles() {
    get<MainCss> {
        call.respond(call.resolveResource("app.css")!!)
    }
}
This works correctly without SSL, but when I start using https, the browser wouldn't load my css, as it's presented using basic http (here's my response):
Copy code
<head>
    <link rel="Stylesheet" type="text/css" href="<http://my.domain.com/styles/main.css>">
</head>
Any idea what I should modify to make it https friendly?
c
href="://my.domain.com/styles/main.css"
k
So I have no other choice than hard writing my domain name? This is unfortunate as I need to to run my app twice on different domains
d
//my.domain.com/styles/main.css
is the one to specify a different domain while keeping he protocol
/styles/main.css
for the same domain
let me check
@kluck
Copy code
styleLink(url(MainCss()) {
    protocol = URLProtocol.createOrDefault(request.origin.scheme)
})
k
thanks, I'll try that