Altinn / app-localtest

Solution for testing apps locally on your own machine
8 stars 14 forks source link

Support any version in Index.cshtml when replacing frontend version #83

Closed bjosttveit closed 7 months ago

bjosttveit commented 7 months ago

Description

This adds support for replacing any frontend version in Index.cshtml. Unfortunately, this was a bit more involved than expected, since the standard sub_filter only allows simple string substitution and not regex. To get around this, I needed the third-party ngx_http_substitutions_filter_module. This required some modifications to the standard docker image for nginx which I based on this.

This also fixes a bug where it would not find the frontendVersion cookie if it was the last one in the Cookies header. This is because it previously required the string to end with a ;. This probably explains the flakyness I myself have experienced with this before.

Related Issue(s)

Verification

bjosttveit commented 7 months ago

Sounds like a good idea to get rid of nginx @ivarne, this is indeed an overcomplicated way to do this 😅

Should I still merge this as a short term fix? And then maybe we should create an issue to look into rewriting the proxy feature?

ivarne commented 7 months ago

Should I still merge this as a short term fix?

Yes, That is what an approval with no positive comment means. If it works and is better than what we have, it is ready for merge.