R Shiny rCharts https server failing to load fonts.googleapis.com

喜欢而已 提交于 2019-12-12 15:11:01

问题


I got a shiny https server running, and I tried to use rCharts to plot a dTable so that I could do multi-column sort from dataTables (see https://stackoverflow.com/a/20956772/719016).

What I could deduct from the Console output and this explanation (http://yoast.com/wordpress-ssl-setup/) is that this rCharts table is trying to load fonts from fonts.googleapis.com via the templates/default.html in shiny:

[blocked] The page at 'https://my.server.com/shiny/shiny_dev/' was loaded over HTTPS, but ran insecure content from 'http://fonts.googleapis.com/css?family=Source+Code+Pro': this content should also be loaded over HTTPS.

Any ideas how to fix this without admin access to the shiny server?

Can I override the fonts that are attempted to be loaded in my server.R or ui.R code?


回答1:


You can try manually loading font over https, which Google Fonts also supports.

 ui = bootstrapPage(
    tags$link(
      rel = "stylesheet", 
      href="https://fonts.googleapis.com/css?family=Source+Code+Pro"
    ),
    tags$style("h1{font-family: 'Source Code Pro'}"),
    tags$h1("Test Font"),
    numericInput('n', 'Number of obs', 100),
    plotOutput('plot')
  )


来源:https://stackoverflow.com/questions/20971453/r-shiny-rcharts-https-server-failing-to-load-fonts-googleapis-com

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!