File not found in Http but woks in Https

Hi,

In our website we have FontAwesome and when loading resources the FontAwesome file is getting 404 because it has version number as query parameter. But then the same thing works fine in HTTPS mode.

http://QA/Server/admin/styles/docrecord-sass/fonts/fontawesome-webfont.woff2?v=4.4.0 – Doesn’t work

http://QA/Server/admin/styles/docrecord-sass/fonts/fontawesome-webfont.woff2 – Works

https://QA/Server/admin/styles/docrecord-sass/fonts/fontawesome-webfont.woff2?v=4.4.0 – Works

I’m assuming this is trying to load a static file directly from ServiceStack? Are you going through any kind of Reverse Proxy or url rewriter? Which host are you using ASP.NET, HttpListener or .NET Core? Can you post the raw HTTP Request/Response Headers for the 404 response?

Yes, directly. No Proxy or url rewriter. We are using ASP.Net host.

Accept: /
Accept-Encoding: gzip, deflate
Accept-Language: en-US, en; q=0.5
Connection: Keep-Alive
Cookie: ss-opt=temp; ss-pid=8x45hVccanICSxPitqcz; X-UAId=0; ss-id=0Zu2n7DVQf0olGIXYadR
DNT: 1
Host: qa01
Origin: http://qa
Referer: http://qa/Server/
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/52.0.2743.116 Safari/537.36 Edge/15.15063

Access-Control-Allow-Credentials: true
Access-Control-Allow-Headers: Content-Type, Authorization, X-Requested-With
Access-Control-Allow-Methods: GET, POST, PUT, DELETE, PATCH, OPTIONS
Access-Control-Allow-Origin: *
Content-Length: 3
Content-Type: text/plain
Date: Fri, 19 May 2017 19:00:01 GMT
Server: Microsoft-HTTPAPI/2.0
Vary: Accept
X-Powered-By: ServiceStack/4.58 Win32NT/.NET

These HTTP Headers are incomplete, can you please post the full HTTP Request / Response Headers.

If using Chrome Web Inspector click on view source, if using Fiddler click on the Raw tab to get the full HTTP Headers.

GET /Server/admin/styles/docrecord-sass/fonts/fontawesome-webfont.woff?v=4.4.0 HTTP/1.1
Host: qa
User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:53.0) Gecko/20100101 Firefox/53.0
Accept: application/font-woff2;q=1.0,application/font-woff;q=0.9,/;q=0.8
Accept-Language: en-US,en;q=0.5
Accept-Encoding: identity
Referer: http://qa/Server/admin/styles/docrecord-sass/stylesheets/main.css
Connection: keep-alive

HTTP/1.1 404 Not Found
Content-Length: 3
Content-Type: text/plain
Vary: Accept
Server: Microsoft-HTTPAPI/2.0
X-Powered-By: ServiceStack/4.58 Win32NT/.NET
Access-Control-Allow-Origin: *
Access-Control-Allow-Methods: GET, POST, PUT, DELETE, PATCH, OPTIONS
Access-Control-Allow-Headers: Content-Type, Authorization, X-Requested-With
Access-Control-Allow-Credentials: true
Date: Fri, 19 May 2017 19:15:40 GMT

I can’t repro this issue:

GET http://localhost:54018/dist/img/fontawesome-webfont.woff2?v=4.4.0 HTTP/1.1
Host: localhost:54018
Connection: keep-alive
Pragma: no-cache
Cache-Control: no-cache
Upgrade-Insecure-Requests: 1
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/58.0.3029.110 Safari/537.36
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8
Accept-Encoding: gzip, deflate, sdch, br
Accept-Language: en-US,en;q=0.8
HTTP/1.1 200 OK
Cache-Control: private
Content-Type: application/font-woff2
Last-Modified: Thu, 18 May 2017 16:20:34 GMT
Accept-Ranges: bytes
Vary: Accept
Server: Microsoft-IIS/10.0
X-Powered-By: ServiceStack/4.58 Win32NT/.NET
X-AspNet-Version: 4.0.30319
X-SourceFiles: =?UTF-8?B?Qzpcc3JjXHdpcFxSZWFjdEFwcDJcUmVhY3RBcHAyXGRpc3RcaW1nXGZvbnRhd2Vzb21lLXdlYmZvbnQud29mZjI=?=
X-Powered-By: ASP.NET
Date: Fri, 19 May 2017 19:22:44 GMT
Content-Length: 77160

Even when using your HTTP Request Headers:

GET http://localhost:54018/dist/img/fontawesome-webfont.woff2?v=4.4.0 HTTP/1.1
Host: localhost:54018
User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:53.0) Gecko/20100101 Firefox/53.0
Accept: application/font-woff2;q=1.0,application/font-woff;q=0.9,/;q=0.8
Accept-Language: en-US,en;q=0.5
Accept-Encoding: identity
Referer: http://qa/Server/admin/styles/docrecord-sass/stylesheets/main.css
Connection: keep-alive
HTTP/1.1 200 OK
Cache-Control: private
Content-Type: application/font-woff2
Last-Modified: Thu, 18 May 2017 16:20:34 GMT
Accept-Ranges: bytes
Vary: Accept
Server: Microsoft-IIS/10.0
X-Powered-By: ServiceStack/4.58 Win32NT/.NET
X-AspNet-Version: 4.0.30319
X-SourceFiles: =?UTF-8?B?Qzpcc3JjXHdpcFxSZWFjdEFwcDJcUmVhY3RBcHAyXGRpc3RcaW1nXGZvbnRhd2Vzb21lLXdlYmZvbnQud29mZjI=?=
X-Powered-By: ASP.NET
Date: Fri, 19 May 2017 19:26:28 GMT
Content-Length: 77160

Looks like we’re going to a repro, can you please put together a small stand-alone App that reproduces this issue?

Ok, I’ll try to come up with something. Could it have something to do with SS settings?

I’m assuming something is interfering with the request but nothing comes to mind.