Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Add header check to middleware#16

Open
EcoGabe wants to merge 1 commit intoin2code-de:mainin2code-de/instagram:mainfrom
EcoGabe:fix/add-header-check-to-middlewareEcoGabe/instagram:fix/add-header-check-to-middlewareCopy head branch name to clipboard
Open

Add header check to middleware#16
EcoGabe wants to merge 1 commit intoin2code-de:mainin2code-de/instagram:mainfrom
EcoGabe:fix/add-header-check-to-middlewareEcoGabe/instagram:fix/add-header-check-to-middlewareCopy head branch name to clipboard

Conversation

@EcoGabe
Copy link
Copy Markdown

@EcoGabe EcoGabe commented Mar 1, 2022

With the current way the request is being checked, this middleware will clash with any service using a parameter named "code" as a part of their OAuth flow. Checking if the referer is https://l.instagram.com/ will avoid this problem.

$code = $request->getQueryParams()['code'];
if (strlen($code) > 8) {
return true;
if (in_array('https://l.instagram.com/', $request->getHeader('referer'))) {
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

In my case the referer header contains the App return URL and not l.instagram.com - not sure if instagram changed anything in the way they redirect. With this check, no authentication code can be obtained.

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.

2 participants

Morty Proxy This is a proxified and sanitized view of the page, visit original site.