Pinterest的保存,如果从HTTP重定向到https按钮不起作用上

问题描述 投票:0回答:1

Pinterest could not fetch the image

我发现了一个类似的问题,所以建议从重定向排除pinterest.com,但它并不能帮助。当我尝试使用Pinterest的保存按钮我看到错误信息“出了错对不起!出了错在我们这边,请重试”请帮助解决问题

浏览器控制台

Unhandled Promise Rejection: [DenzelError] {"name":"DenzelError","code":"API_ERROR","http_status":400,"api_error_code":1,"target":null,"stack_trace":null,"extra_data":null,"request_identifier":null}

htaccess的

RewriteEngine On
RewriteCond %{HTTPS} off
RewriteCond %{HTTP_REFERER} !(?:pinterest.com)
RewriteCond %{HTTP:X-Forwarded-Proto} !https
RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]

按钮代码

<a href="https://www.pinterest.com/pin/create/button/?description=description&media=http%3A%2F%2Fwww.site.com%2Fimages%2Fproduct%2Fsmall%2Fimage.gif&url=http%3A%2F%2Fwww.site.com" data-pin-do="buttonPin" data-pin-config="beside">
<img src="//assets.pinterest.com/images/pidgets/pin_it_button.png" />
<img src="//assets.pinterest.com/images/pidgets/pinit_fg_en_round_red_32.png" />
</a> 
.htaccess pinterest
1个回答
0
投票

支持响应:1)Pinterest的爬虫只能抓取到网站在SSL工具https://www.ssllabs.com/ssltest/ 2)Pinterest的的IP是动态的,因此不断变化的核证,但始终处于范围:54.236.1.XXX

在.htaccess文件我增加了新的例外pinterest.com对于HTTPS重定向的IP。现在,它看起来像这样

RewriteEngine On
RewriteCond %{HTTPS} off
RewriteCond %{HTTP_REFERER} !(?:pinterest.com)
RewriteCond %{REMOTE_ADDR} !^54\.236\.1\.[0-9]{1,3}$
RewriteCond %{HTTP:X-Forwarded-Proto} !https
RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
© www.soinside.com 2019 - 2024. All rights reserved.