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

Issue #83: Refactor wopi controller #84

Merged
merged 70 commits into from
Jan 20, 2025

Conversation

donquixote
Copy link
Collaborator

@donquixote donquixote commented Jan 8, 2025

@donquixote donquixote force-pushed the issue-83-refactor-wopi-controller branch 3 times, most recently from 1883815 to 0a91f3a Compare January 9, 2025 14:23
Copy link
Collaborator

@AaronGilMartinez AaronGilMartinez left a comment

Choose a reason for hiding this comment

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

I think is going to the right direction, added some remarks just in case.

src/Access/WopiProofAccessCheck.php Show resolved Hide resolved
src/Controller/WopiController.php Outdated Show resolved Hide resolved
src/Controller/WopiController.php Show resolved Hide resolved
src/Util/IsoDateTime.php Outdated Show resolved Hide resolved
src/EventSubscriber/ExceptionWopiSubscriber.php Outdated Show resolved Hide resolved
tests/src/Kernel/Controller/WopiControllerTest.php Outdated Show resolved Hide resolved
tests/src/Kernel/Controller/WopiControllerTest.php Outdated Show resolved Hide resolved
tests/src/Kernel/Controller/WopiControllerTest.php Outdated Show resolved Hide resolved
@donquixote donquixote force-pushed the issue-83-refactor-wopi-controller branch 4 times, most recently from b0bd89d to 7819c85 Compare January 15, 2025 02:38
tests/src/Traits/KernelTestLoggerTrait.php Show resolved Hide resolved
src/Controller/WopiController.php Outdated Show resolved Hide resolved
src/MediaHelper.php Show resolved Hide resolved
@donquixote donquixote force-pushed the issue-83-refactor-wopi-controller branch 2 times, most recently from dabead7 to 19b7ce9 Compare January 15, 2025 19:36
Copy link
Collaborator

@AaronGilMartinez AaronGilMartinez left a comment

Choose a reason for hiding this comment

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

Changes look good, but to be sure a rebase would be needed please.

… in services.yml, and setting Content-Type header.

Without that, the ExceptionWopiSubscriber was not actually registered as an event subscriber.
It did not matter because routes with any '_format' other than 'html' already behave in the desired way.
Now, to replicate the prior behavior, we must explicitly set the 'Content-Type' header to 'text/plain'.
…t keep 403.

Changes:
- Use wildcard loading for media entity in WopiController.
- Change 'not found' response code and message for WOPI requests, to replicate old behavior.

Subsequent commit will change to actual 404.
@donquixote donquixote force-pushed the issue-83-refactor-wopi-controller branch from 19b7ce9 to b6b4a36 Compare January 17, 2025 14:43
@donquixote donquixote marked this pull request as ready for review January 17, 2025 17:51
@AaronGilMartinez AaronGilMartinez merged commit aea55fb into main Jan 20, 2025
3 checks passed
@AaronGilMartinez AaronGilMartinez deleted the issue-83-refactor-wopi-controller branch January 20, 2025 10:32
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.

Refactor WopiController
2 participants