Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix getMauticVersion() accessing lower-case headers as array-key #302

Merged
merged 1 commit into from
May 9, 2023

Conversation

Moongazer
Copy link
Contributor

Fixes #233

Ensures that the mautic-version header key is always converted to lowercase prior to checking if it exists. This makes the getMauticVersion() command less error-prone, e.g. if Nginx is used as reverse-proxy which convertes HTTP headers to lower-case.

Copy link
Member

@escopecz escopecz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Makes sense. Thank you!

@escopecz escopecz merged commit a1cd1fe into mautic:main May 9, 2023
@Moongazer Moongazer deleted the fix/issue-233 branch June 15, 2023 08:48
@Moongazer
Copy link
Contributor Author

@escopecz Currently this fix is not available in the current version of 3.1, which breaks OAuth2 again if a reverse-proxy is used somewhere in the server setup.

Will it be available later if you rebasing the 3.x branch with 2.x or do we need a new PR?

@escopecz
Copy link
Member

I'm looking at the changes that were merged already and there are some BC breaks. So we'll have to release it as new major version (4.0). I'm currently focusing on getting Mautic 5 released so I won't have time to get this repository prepared for new major release in next few months. Do you have some time give this library some love? There are other great PRs that are waiting for review and tests.

If you or anyone else would like to be on the maintenance team for this repo, please let me or @RCheesley know.

As a way around this issue you can use the main branch in your composer.json instead of a tagged version to get use the unreleased changes in your app.

@Moongazer
Copy link
Contributor Author

Moongazer commented Jun 15, 2023

I haven't seen that v3 was branched off from main before this PR, so all good I think. Regarding maintaining: its a bit difficult as I'm pretty busy already spending the few hours I have on mautic-typo3, but because its dependency on api-library, probably I have to spend some time on here also, to push everything forward. Right now we focus on making mautic-typo3 ready for TYPO3 v11 which is tricky, because it can run on both, PHP 7 and 8 (but for 8 it relys on api-library current main)...

So yes, if I can help to test something to bring forward a minimal PHP 8 release, I will do what I can. It would be helpful to have a list of most-wanted/most-important PRs or features to focus on.

@escopecz
Copy link
Member

@Moongazer I had a chat with @mollux yesterday and he's planning to make a new major version (4-alpha) while keeping the 3.x version still alive. I'm sure Mattias will reach out if he'll need some help here and there. Right now he's trying to get #288 in for the 4-alpha version so if you could give another review/test that'd be great.

@RCheesley RCheesley added this to the 4.0 milestone Jul 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Api.php: getMauticVersion() always returns null due to header key is lower-case
3 participants