Starcounter / Home

Starcounter is an in-memory database application engine.
https://starcounter.io
27 stars 1 forks source link

Implement case-insensitive HTTP headers #178

Closed warpech closed 7 years ago

warpech commented 7 years ago

Right now, pages served via PartialToStandaloneHtmlProvider do not work correctly when HTTP headers like Accept are sent in lowercase (accept).

This turned out to be a problem when Cloudflare is ran as a HTTPS proxy for Starcounter, because then it rewrites all the request headers to be lowercase (see: https://github.com/Starcounter/AdminTrack/issues/296)

Steps to reproduce the problem

  1. Start WebsiteEditor and WebsiteProvider from https://github.com/starcounterapps/website/tree/ca199025da05ef61b894223d45b470d4ae912f2f
  2. Call in cURL: curl -XGET -H 'accept: text/html' -i 'http://localhost:8080/WebsiteEditor' (or use Postman)

Expected

You should get a HTML response.

Actual

You get a JSON response.

Note that for this command: curl -XGET -H 'Accept: text/html' -i 'http://localhost:8080/WebsiteEditor' you get the expected response.

Screenshot

2017-07-11 14_06_14-mingw64__c_users_warpe

Starcounter version 2.3.1.6682

Related: https://github.com/Starcounter/level1/issues/2315

ghost commented 7 years ago

The problem was identified and fixed. Tests added. @PatrykSzwer you can test with your HTTPS proxy, it should work now.