Google Chrome 控制台中的奇数失败请求 AngularJS SPA
Odd failed request in Google Chrome console in AngularJS SPA
我有一个 AngularJS 单页应用程序,它从 C# Web API 服务发送和检索数据。这两个应用程序都托管在 Amazon Elastic Beanstalk 上。我定期在 Google Chrome 开发人员控制台中收到失败的请求。请求是 http://singlepageapp.elasticbeanstalk.com/null. It bugs me because I can't work out where it originated from. All Ajax requests in my application come from the same place, and always have the base URI (http://mywebapi.elasticbeanstalk.com/) 和 'api/' 以及 Web API 控制器的名称 appended.The 开发者控制台显示如下:
Request URL:http://singlepageapp.elasticbeanstalk.com/null
Request Method:GET
Status Code:404 Not Found
导致错误的原始请求如下:
GET /null HTTP/1.1
Host: singlepageapp.elasticbeanstalk.com
Connection: keep-alive
Accept-Encoding: identity;q=1, *;q=0
User-Agent: Mozilla/5.0 (Windows NT 6.3; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/45.0.2454.85 Safari/537.36
Accept: */*
Referer: http://singlepageapp.elasticbeanstalk.com/
Accept-Language: en
Range: bytes=0-1244
Chrome 将类型列为 'media',将发起者列为 'other'。任何想法将不胜感激。非常感谢。
编辑:我刚刚再次收到错误并注意到请求不是针对我的网络 api,而是针对弹性 beanstalk 单页应用程序。我的逻辑没有(直接)请求这个 URI,所有这些都是由浏览器发起的,以响应用户单击 link。在这种情况下,一个 'page' 上的 'Save' 按钮在成功保存后运行以下命令:
$location.path('/next-page');
就是这个触发了错误的请求。通过单击菜单中的 link 直接转到此 URI 时不会发生这种情况。
好的,找到问题了。有问题的页面允许用户使用他们的网络摄像头拍照。当他们单击 'Save' 按钮时,他们将被带到另一个页面。然而,在此之前,逻辑会执行以下操作:
video.src = null;
其中 'video' 是页面中的以下元素:
<video class="cssimageclass" autoplay></video>
将 src 设置为 null 发起了浏览器请求。删除它可以解决问题。
我有一个 AngularJS 单页应用程序,它从 C# Web API 服务发送和检索数据。这两个应用程序都托管在 Amazon Elastic Beanstalk 上。我定期在 Google Chrome 开发人员控制台中收到失败的请求。请求是 http://singlepageapp.elasticbeanstalk.com/null. It bugs me because I can't work out where it originated from. All Ajax requests in my application come from the same place, and always have the base URI (http://mywebapi.elasticbeanstalk.com/) 和 'api/' 以及 Web API 控制器的名称 appended.The 开发者控制台显示如下:
Request URL:http://singlepageapp.elasticbeanstalk.com/null
Request Method:GET
Status Code:404 Not Found
导致错误的原始请求如下:
GET /null HTTP/1.1
Host: singlepageapp.elasticbeanstalk.com
Connection: keep-alive
Accept-Encoding: identity;q=1, *;q=0
User-Agent: Mozilla/5.0 (Windows NT 6.3; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/45.0.2454.85 Safari/537.36
Accept: */*
Referer: http://singlepageapp.elasticbeanstalk.com/
Accept-Language: en
Range: bytes=0-1244
Chrome 将类型列为 'media',将发起者列为 'other'。任何想法将不胜感激。非常感谢。
编辑:我刚刚再次收到错误并注意到请求不是针对我的网络 api,而是针对弹性 beanstalk 单页应用程序。我的逻辑没有(直接)请求这个 URI,所有这些都是由浏览器发起的,以响应用户单击 link。在这种情况下,一个 'page' 上的 'Save' 按钮在成功保存后运行以下命令:
$location.path('/next-page');
就是这个触发了错误的请求。通过单击菜单中的 link 直接转到此 URI 时不会发生这种情况。
好的,找到问题了。有问题的页面允许用户使用他们的网络摄像头拍照。当他们单击 'Save' 按钮时,他们将被带到另一个页面。然而,在此之前,逻辑会执行以下操作:
video.src = null;
其中 'video' 是页面中的以下元素:
<video class="cssimageclass" autoplay></video>
将 src 设置为 null 发起了浏览器请求。删除它可以解决问题。