Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why does IIS return empty responses?

I just published an AngularJS/WebAPI project using File system publish to a local IIS Application and I can open the website in my browser. Unfortunately, no resources such as images, css etc. can be loaded. When I try to reach any file located in a sub folder I still receive a HTTP 200 from the server, but the body is empty. I can remember I´ve had this issue a few years back but I can´t remember why this happens.

Request

GET http://localhost/Content/images/common/logotype.png HTTP/1.1
Host: XX.XXX.XX.XXX
Connection: keep-alive
Cache-Control: max-age=0
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8
Upgrade-Insecure-Requests: 1
User-Agent: Mozilla/5.0 (Windows NT 6.3; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/44.0.2403.130 Safari/537.36
Accept-Encoding: gzip, deflate, sdch
Accept-Language: en-US,en;q=0.8,sv;q=0.6

Response

HTTP/1.1 200 OK
Server: Microsoft-IIS/8.5
X-Powered-By: ASP.NET
Date: Tue, 25 Aug 2015 07:56:12 GMT
Content-Length: 0

As you can see, there is no body at all but the image exists in the folder and I can open it from the filesystem. I would guess that if this was a privilege issue the server would return 403 or a similar error, not 200 OK?

like image 771
Marcus Avatar asked Aug 25 '15 08:08

Marcus


1 Answers

Facepalm

Turns out that Lex Li:s comment put me in the right direction. I had completely missed to include the "Static Content" feature was missing in IIS "Common HTTP Features".

Adding the "Static Content" feature

like image 191
Marcus Avatar answered Sep 29 '22 10:09

Marcus