使用工具时URL禁止403,但从浏览器中可以使用 [英] URL forbidden 403 when using a tool but fine from browser

查看:62
本文介绍了使用工具时URL禁止403,但从浏览器中可以使用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一些图像,我需要执行HttpRequestMethod.HEAD才能找到图像的一些细节.

I have some images that I need to do a HttpRequestMethod.HEAD in order to find out some details of the image.

当我在浏览器中转到图像URL时,它会毫无问题地加载.

When I go to the image url on a browser it loads without a problem.

当我尝试通过我的代码或通过在线工具获取标头信息时,它会失败

When I attempt to get the Header info via my code or via online tools it fails

示例URL是 http://www.adorama.com/images/large/CHHB74P.JPG

如前所述,我已经使用在线工具 Hurl.It 尝试达到Head请求,但我正在获得我在代码中收到的相同的403禁止消息.我尝试将许多不同的标头添加到标头请求(用户代理,接受,接受编码,接受语言,高速缓存控制,连接,主机,实用程序,升级不安全请求),但这似乎都不起作用.

As mentioned, I have used the online tool Hurl.It to try and attain the Head request but I am getting the same 403 Forbidden message that I am getting in my code. I have tried adding many various headers to the Head request (User-Agent, Accept, Accept-Encoding, Accept-Language, Cache-Control, Connection, Host, Pragma, Upgrade-Insecure-Requests) but none of this seems to work.

它也无法通过Hurl.it进行普通的GET请求.同样的403错误.

It also fails to do a normal GET request via Hurl.it. Same 403 error.

如果相关,则我的代码是c#Web服务,并且在AWS云上运行(以防adorador服务器上有我不知道的针对AWS的东西).为了测试这一点,我还启动了一个ec2(Linux机器)并运行curl,它还返回了403错误.在我的个人计算机上本地运行curl将返回二进制图像,该二进制图像大概只是图像数据.

If it is relevant, my code is a c# web service and is running on the AWS cloud (just in case the adorama servers have something against AWS that I dont know about). To test this I have also spun up an ec2 (linux box) and run curl which also returned the 403 error. Running curl locally on my personal computer returns the binary image which is presumably just the image data.

为了消除显而易见的想法,我的代码在许多其他网站上都可以成功运行,只是这个网站存在问题

And just to remove the obvious thoughts, my code works successfully for many many other websites, it is just this one where there is an issue

您知道我要下载图像标题而不获取403时需要什么吗?

Any idea what is required for me to download the image headers and not get the 403?

推荐答案

这里有同样的问题.

在本地可以正常运行.从一个AWS实例执行此操作,我遇到了同样的问题.

Locally it works smoothly. Doing it from an AWS instance I get the very same problem.

我认为这是DNS解析问题(重定向到故障节点).因此,我尝试指定与客户端解析的IP地址相同的IP地址,但没有解决问题.

I thought it was a DNS resolution problem (redirecting to a malfunctioning node). I have therefore tried to specify the same IP address as it was resolved by my client but didn't fix the problem.

我的猜测是Akamai(在这种情况下,该服务由Akamai CDN提供)正在阻止AWS.以某种方式可以理解,客户通过流量为CDN付费,滥用它可以使人们产生巨额账单.

My guess is that Akamai (the service is provided by an Akamai CDN in this case) is blocking AWS. It is understandable somehow, customers pay by traffic for CDN, by abusing it, people can generate huge bills.

连接到www.adorama.com(www.adorama.com)| 104.86.164.205 |:80 ...已连接.

Connecting to www.adorama.com (www.adorama.com)|104.86.164.205|:80... connected.

HTTP request sent, awaiting response... 
HTTP/1.1 403 Forbidden
Server: **AkamaiGHost**
Mime-Version: 1.0
Content-Type: text/html
Content-Length: 301
Cache-Control: max-age=604800
Date: Wed, 23 Mar 2016 09:34:20 GMT
Connection: close
2016-03-23 09:34:20 ERROR 403: Forbidden.

这篇关于使用工具时URL禁止403,但从浏览器中可以使用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆