fix: Some HTTP requests sent by apps don't have their data parsed into JSON - #30560
Merged
Conversation
🦋 Changeset detectedLatest commit: 794f7ca The changes in this PR will be included in the next version bump. This PR includes changesets to release 31 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
d-gubert
marked this pull request as draft
October 3, 2023 23:15
Codecov Report
@@ Coverage Diff @@
## develop #30560 +/- ##
===========================================
- Coverage 51.28% 51.24% -0.04%
===========================================
Files 811 804 -7
Lines 15074 15109 +35
Branches 2752 2767 +15
===========================================
+ Hits 7731 7743 +12
- Misses 6935 6941 +6
- Partials 408 425 +17
Flags with carried forward coverage won't be shown. Click here to find out more. |
d-gubert
marked this pull request as ready for review
October 4, 2023 13:49
geekgonecrazy
approved these changes
Oct 4, 2023
geekgonecrazy
left a comment
Contributor
There was a problem hiding this comment.
Would still like to understand why this check was even added?
murtaza98
approved these changes
Oct 4, 2023
murtaza98
left a comment
Contributor
There was a problem hiding this comment.
Verified that this fix works with the help of Salesforce App...where we'd initially detected this issue
Contributor
|
Thanks @d-gubert 🙌 |
gabriellsh
added a commit
that referenced
this pull request
Oct 16, 2023
…/mentionBot * 'develop' of github.com:RocketChat/Rocket.Chat: feat: add tooltip to badge mentions (#30590) chore: improve `Tag` a11y link (#30636) refactor: Replace `useForm` in favor of RHF on `AppInstallPage` (#30634) fix: Improve FileProxy Handling, set Content-Type (#30427) refactor: `EditRoomInfo` to typescript (#28318) fix: mobile ringing notification missing call id (#30614) fix: Some HTTP requests sent by apps don't have their data parsed into JSON (#30560) test: More tests for groups kick (#30536) fix: Threads breaking after sending messages too fast (#30622) chore: Remove text decoration from room tag (#30606) i18n: Language update from LingoHub 🤖 on 2023-10-10Z (#30613) fix: File attachments have no content when exporting room messages as file (#30596) fix: use setImmediate to handle username update (#30500) chore: `AnalyticsReports` visual adequacy (#30617)
debdutdeb
pushed a commit
that referenced
this pull request
Oct 26, 2023
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Proposed changes (including videos or screenshots)
Removes the validation in the
jsonParserfunction in@rocket.chat/server-fetchpackage to allow the API to stringify the body of requests of any method, as long as the request has the content type "application/json"This was the default behavior prior to adopting the package.
Issue(s)
Steps to test or reproduce
Further comments
The validation checking for either POST, PUT or DELETE request methods before stringifying the body of the request broke compatibility with the Apps-Engine API. Besides that, it would make sense for any request with the header
Content-Type: application/jsonand a serializable object as body to have this object stringified - otherwise the request will be sent with a body of[object Object]- and stringifying the content of other methods (GET, HEAD, CONNECT, etc.) is not detrimental to the API in any way