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

Allow the client to specify the image type using Accept header #982

Merged
merged 7 commits into from
May 12, 2022

Conversation

christianlupus
Copy link
Collaborator

Closes #954

This is a quick fix for issue #954. This checks the accept header and returns a 406 HTTP error in case no JPG file was found on the server,

This is not yet capable to support other image files (like PNG) but this is the first step toward multi-type image files. The multi-type must be implemented separately as it is a more involved change/refactor involved.

Signed-off-by: Christian Wolf <github@christianwolf.email>
Signed-off-by: Christian Wolf <github@christianwolf.email>
Signed-off-by: Christian Wolf <github@christianwolf.email>
Signed-off-by: Christian Wolf <github@christianwolf.email>
@codecov
Copy link

codecov bot commented May 10, 2022

Codecov Report

Merging #982 (81b4661) into master (f1cec2e) will increase coverage by 2.70%.
The diff coverage is 100.00%.

❗ Current head 81b4661 differs from pull request most recent head 68a3171. Consider uploading reports for the commit 68a3171 to get more accurate results

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #982      +/-   ##
==========================================
+ Coverage   29.59%   32.30%   +2.70%     
==========================================
  Files          31       32       +1     
  Lines        1561     1619      +58     
==========================================
+ Hits          462      523      +61     
+ Misses       1099     1096       -3     
Flag Coverage Δ
integration 5.25% <0.00%> (-0.20%) ⬇️
unittests 27.05% <100.00%> (+2.90%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
lib/Controller/RecipeController.php 100.00% <100.00%> (+4.47%) ⬆️
lib/Helper/AcceptHeaderParsingHelper.php 100.00% <100.00%> (ø)
lib/Helper/ImageService/ThumbnailFileHelper.php 97.05% <100.00%> (+0.18%) ⬆️

Signed-off-by: Christian Wolf <github@christianwolf.email>
Signed-off-by: Christian Wolf <github@christianwolf.email>
@github-actions
Copy link

github-actions bot commented May 10, 2022

Unit Test Results

     24 files       24 suites   8m 51s ⏱️
   138 tests    138 ✔️ 0 💤 0
1 656 runs  1 656 ✔️ 0 💤 0

Results for commit 68a3171.

♻️ This comment has been updated with latest results.

@christianlupus christianlupus requested a review from seyfeb May 10, 2022 19:24
lib/Controller/RecipeController.php Outdated Show resolved Hide resolved
lib/Helper/AcceptHeaderParsingHelper.php Outdated Show resolved Hide resolved
Co-authored-by: Sebastian Fey <info@sebastianfey.de>
Signed-off-by: Christian Wolf <github@christianwolf.email>
@christianlupus christianlupus force-pushed the fix/954-image-file-types branch from 673e03c to 68a3171 Compare May 12, 2022 05:57
@christianlupus christianlupus merged commit 868aee4 into master May 12, 2022
@delete-merged-branch delete-merged-branch bot deleted the fix/954-image-file-types branch May 12, 2022 06:24
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.

Recipe Image Endpoint should not return two different data types
2 participants