Skip to content
This repository has been archived by the owner on Jan 30, 2020. It is now read-only.

Throw exception when header is invalid #187

Merged
merged 1 commit into from
Nov 29, 2019
Merged

Throw exception when header is invalid #187

merged 1 commit into from
Nov 29, 2019

Conversation

michalbundyra
Copy link
Member

Fixes #180 - infinite recursion

  • Are you fixing a bug?
    • Detail how the bug is invoked currently.
    • Detail the original, incorrect behavior.
    • Detail the new, expected behavior.
    • Base your feature on the master branch, and submit against that branch.
    • Add a regression test that demonstrates the bug, and proves the fix.
    • Add a CHANGELOG.md entry for the fix.

Fixes #180 - infinite recursion
@roypalacios
Copy link

roypalacios commented Oct 11, 2019

Hi @webimpress,

It looks good to me. I'll only add few comments:

            // Generic Header should throw an exception if it fails
            if ($isGeneric) {
                throw $exception;
            }

            // Retry one more time with GenericHeader
            return $this->lazyLoadHeader($index, true);

Also, there is a minor optimization we can make at the beginning of the file:

If Generic is true, there is no need parse the key and call the ClassLoader.

I have an enhancement in 2.11.0, so if there's anything I can do to get there, please ask :)

@michalbundyra
Copy link
Member Author

@roypalacios

Thanks for suggestions. I should be working on zend-http 'soon'. As you can see there is a lot of PR I've created recently and more is incoming. I just need to find a time to describe and merge all of them to issue new release. Thanks for your patience.

michalbundyra added a commit that referenced this pull request Nov 29, 2019
Throw exception when header is invalid
michalbundyra added a commit that referenced this pull request Nov 29, 2019
@michalbundyra michalbundyra merged commit ad57a6f into zendframework:master Nov 29, 2019
michalbundyra added a commit that referenced this pull request Nov 29, 2019
@michalbundyra michalbundyra deleted the hotfix/infinite-loop branch November 29, 2019 19:35
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Invalid header results in infinite recursion
3 participants