ironjan / klausurtool-ror

Previous Klausurtool of the FSMI UPB.
Apache License 2.0
2 stars 0 forks source link

Fix AusleiheController #switch action #236

Open ironjan opened 7 years ago

ironjan commented 7 years ago

Steps to reproduce:

  1. Go to https://ausleihe.die-fachschaft.de/internal/ausleihe
  2. Lend a folder

What happens: Lending form is HTTP. Expected: Lending form should be delivered https.

Notes

Gigadoc2 commented 7 years ago

The web server should handle SSL termination and enforcement, unless there is a reason to enforce HTTPS on selected (and changing) paths only.

ironjan commented 7 years ago

234 could've been caused by a missing https configuration. AW updated certificates and turned on https on all routes, but the tool itself prefers http. To check this: go to https://ausleihe.die-fachschaft.de/internal/ausleihe and lend a folder; the lending form is delivered via http instead of https.

Note that #236 has a very low priority as the deployment is still done via docker :'(

Gigadoc2 commented 7 years ago

I'm confused, for me everything except the yahooapis css is delivered via https…

Is the tool using absolute urls somewhere?

ironjan commented 7 years ago

The tool does not use absolute URLs in the code except for external resources (die-fachschaft.de, github, the css you mentioned [0]).

It seems that the error is located in https://github.com/ironjan/klausurtool-ror/blob/master/app/controllers/ausleihe_controller.rb#L81 . This method will redirect the user according to input (lending_form, returning_form). It seems, that the redirects here pick HTTP over HTTPS for some reason.

Using the other functions of the tool over HTTPS works as intented.

[0] …which probably should be available via HTTPS or delivered by the app itself.