【问题标题】:Generating Secure (https) URLs from AppEngine ImagesService从 AppEngine ImagesService 生成安全 (https) URL
【发布时间】:2017-10-17 00:51:05
【问题描述】:

默认情况下,Google 的 AppEngine ImagesService 会返回图片的非安全 (http) URL。如果它有一个可以生成安全 (https) URL 的方法,那就太好了。例如,getServingUrl 可以由 getSecureServingUrl 补充。

【问题讨论】:

    标签: java google-app-engine


    【解决方案1】:

    getServingUrl 方法已经允许您在 ServingUrlOptions 中指定“安全”。

    【讨论】:

      【解决方案2】:

      一个(不够充分的)解决方法是简单地将 URL 中的 http:// 替换为 https://。这可行,但由于它没有记录,它可能随时停止工作。例如:

      url.replaceAll("^http:", "https:")
      

      会起作用的。

      【讨论】:

        猜你喜欢
        • 2014-08-17
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2015-05-02
        • 1970-01-01
        • 1970-01-01
        • 2023-03-14
        相关资源
        最近更新 更多