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

configurable mime types for advanced static files server #240

Merged
merged 1 commit into from
Jun 12, 2020

Conversation

Rastusik
Copy link
Contributor

@Rastusik Rastusik commented Jun 4, 2020

Implementation according to #238

Closes #238

@codecov
Copy link

codecov bot commented Jun 4, 2020

Codecov Report

Merging #240 into develop will increase coverage by 0.16%.
The diff coverage is 62.50%.

Impacted file tree graph

@@              Coverage Diff              @@
##             develop     #240      +/-   ##
=============================================
+ Coverage      86.77%   86.93%   +0.16%     
+ Complexity       647      621      -26     
=============================================
  Files             88       85       -3     
  Lines           2011     1921      -90     
=============================================
- Hits            1745     1670      -75     
+ Misses           266      251      -15     
Impacted Files Coverage Δ Complexity Δ
...mfony/Bundle/DependencyInjection/Configuration.php 94.17% <46.66%> (-3.74%) 10.00 <0.00> (+3.00) ⬇️
...erver/RequestHandler/AdvancedStaticFilesServer.php 88.88% <85.71%> (+0.42%) 12.00 <1.00> (+1.00)
...ony/Bundle/DependencyInjection/SwooleExtension.php 89.02% <100.00%> (+0.13%) 48.00 <0.00> (-24.00) ⬆️
...ny/Bundle/ErrorHandler/ThrowableHandlerFactory.php
...ny/Bundle/ErrorHandler/ExceptionHandlerFactory.php
...ny/Bundle/ErrorHandler/SymfonyExceptionHandler.php

@Rastusik Rastusik force-pushed the 238_asfs_mime_types branch from 1ee9db0 to fb71c7e Compare June 10, 2020 13:31
@Rastusik
Copy link
Contributor Author

@k911 what about this PR? It seems like I can't do anything with the §ci/circleci: docker-buildx-bake-74 problem and don't know what to do about the others

@@ -24,7 +25,8 @@ final class AdvancedStaticFilesServer implements RequestHandlerInterface, Bootab
*
* @see https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/MIME_types/Complete_list_of_MIME_types
*/
private const FILE_EXTENSION_MIME_TYPE_MAP = [
private $FILE_EXTENSION_MIME_TYPE_MAP = [
'*' => 'application/octet-stream', // fallback for other file types
Copy link

Choose a reason for hiding this comment

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

Define a constant instead of duplicating this literal "application/octet-stream" 3 times.

@codeclimate
Copy link

codeclimate bot commented Jun 12, 2020

Code Climate has analyzed commit fb71c7e and detected 2 issues on this pull request.

Here's the issue category breakdown:

Category Count
Style 1
Clarity 1

Note: there is 1 critical issue.

The test coverage on the diff in this pull request is 62.5% (50% is the threshold).

This pull request will bring the total coverage in the repository to 86.9% (-0.2% change).

View more on Code Climate.

@k911 k911 merged commit 07896a4 into k911:develop Jun 12, 2020
@k911
Copy link
Owner

k911 commented Jun 12, 2020

@Rastusik Thanks for your contribution!

@Rastusik
Copy link
Contributor Author

@k911 thanks for the merge :)

k911 added a commit that referenced this pull request Jun 24, 2020
* build(deps-dev): bump doctrine/annotations from 1.10.2 to 1.10.3 (#223) ([94ef806](94ef806)), closes [#223](#223)
* build(deps-dev): bump phpstan/phpstan from 0.12.28 to 0.12.29 (#249) ([ebf9ce1](ebf9ce1)), closes [#249](#249)
* build(deps-dev): bump phpstan/phpstan-doctrine from 0.12.15 to 0.12.16 (#248) ([830a9ef](830a9ef)), closes [#248](#248)
* build(deps-dev): bump phpstan/phpstan-doctrine from 0.12.16 to 0.12.17 (#263) ([d796528](d796528)), closes [#263](#263)
* chore(composer): add suggestion to use pixelfederation/doctrine-resettable-em-bundle to be able to r ([496c5fe](496c5fe)), closes [#226](#226)
* chore(composer): upgrade deps (#246) ([7e44a89](7e44a89)), closes [#246](#246)
* chore(composer): upgrade deps (#262) ([c9b218a](c9b218a)), closes [#262](#262)
* chore(deps): upgrade composer dependencies (#222) ([37d2517](37d2517)), closes [#222](#222)
* fix(config): allow configuring worker and reactor counts using ENV variables (#244) ([d6b270a](d6b270a)), closes [#244](#244)
* fix(profiler): make log collection in symfony profiler to work (#242) ([50fdd6f](50fdd6f)), closes [#242](#242)
* refactor(error-handler): move to proper namespace (#251) ([4c1c3e9](4c1c3e9)), closes [#251](#251)
* feat(blackfire): Add bridge for upscale/swoole-blackfire (#221) ([960ddb8](960ddb8)), closes [#221](#221)
* feat(exception-handler): Add Symfony error/exception handler (#228) ([180d5e5](180d5e5)), closes [#228](#228)
* feat(http-server): configurable mime types for advanced static files server (#240) ([07896a4](07896a4)), closes [#240](#240)
* ci(circle): upgrade docker client image to v19.03.11 (#239) ([fe7b46c](fe7b46c)), closes [#239](#239)
@Rastusik Rastusik deleted the 238_asfs_mime_types branch July 27, 2022 15:30
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

AdvancedStaticFileServer should fallback to mime type text/plain on when serving unknown file extension
2 participants