【发布时间】:2017-10-17 00:51:05
【问题描述】:
默认情况下,Google 的 AppEngine ImagesService 会返回图片的非安全 (http) URL。如果它有一个可以生成安全 (https) URL 的方法,那就太好了。例如,getServingUrl 可以由 getSecureServingUrl 补充。
【问题讨论】:
默认情况下,Google 的 AppEngine ImagesService 会返回图片的非安全 (http) URL。如果它有一个可以生成安全 (https) URL 的方法,那就太好了。例如,getServingUrl 可以由 getSecureServingUrl 补充。
【问题讨论】:
getServingUrl 方法已经允许您在 ServingUrlOptions 中指定“安全”。
【讨论】:
一个(不够充分的)解决方法是简单地将 URL 中的 http:// 替换为 https://。这可行,但由于它没有记录,它可能随时停止工作。例如:
url.replaceAll("^http:", "https:")
会起作用的。
【讨论】: