Bug 36979 - [mono-fastcgi] invalid redirect from https to http
Summary: [mono-fastcgi] invalid redirect from https to http
Status: RESOLVED FIXED
Alias: None
Product: Runtime
Classification: Mono
Component: Tools ()
Version: unspecified
Hardware: PC Linux
: --- normal
Target Milestone: ---
Assignee: João Matos
URL:
Depends on:
Blocks:
 
Reported: 2015-12-14 15:05 UTC by Artem
Modified: 2015-12-14 17:42 UTC (History)
3 users (show)

Tags:
Is this bug a regression?: ---
Last known good build:

Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and Mono organizations on GitHub to continue tracking issues. Bugzilla will remain available for reference in read-only mode. We will continue to work on open Bugzilla bugs, copy them to the new locations as needed for follow-up, and add the new items under Related Links.

Our sincere thanks to everyone who has contributed on this bug tracker over the years. Thanks also for your understanding as we make these adjustments and improvements for the future.


Please create a new report on GitHub or Developer Community with your current version information, steps to reproduce, and relevant error messages or log files if you are hitting an issue that looks similar to this resolved bug and you do not yet see a matching new report.

Related Links:
Status:
RESOLVED FIXED

Description Artem 2015-12-14 15:05:18 UTC
In case application running on fastcgi with virtual path 'test', requests to 'test' are redirected to 'test/', but with hard coded http protocol. For instance:
 
http://localhost/test -> http://localhost/test/   OK
https://localhost/test -> http://localhost/test/  ACTUAL & INVALID
https://localhost/test -> https://localhost/test/  EXPECTED

The problem is with hard coded http protocol in fastcgi ApplicationHost
https://github.com/mono/xsp/blob/master/src/Mono.WebServer.FastCgi/ApplicationHost.cs#L69

Instead of hard coded 'http://{0}{1}' ApplicationHost should use HttpWorkerRequest.IsSecure property
Comment 1 João Matos 2015-12-14 15:47:53 UTC
Since it seems you've already figured out the problem and solution, would you send us a pull request over Github so we can this fix reviewed and integrated?
Comment 2 Artem 2015-12-14 17:28:25 UTC
https://github.com/mono/xsp/pull/72