Skip to content

Ambari 9016 branch 2.7#3015

Merged
kasakrisz merged 9 commits intoapache:branch-2.7from
payert:AMBARI-9016-branch-2.7
Jun 21, 2019
Merged

Ambari 9016 branch 2.7#3015
kasakrisz merged 9 commits intoapache:branch-2.7from
payert:AMBARI-9016-branch-2.7

Conversation

@payert
Copy link
Copy Markdown

@payert payert commented Jun 17, 2019

What changes were proposed in this pull request?

Ambari almost always responds with "Content-Type:text/plain" even if the response content itself is a JSON. Also, if Ambari is requested with "Content-Type:application/json" if fails with an exception.
This changes proposes a filter that:

  • Change the Content-Type of a request to text/plain if the original Content-Type is application/json to prevent Ambari failing on the application/json content.

  • Change to response's Content-Type to application/json if the original request's Content-Type is application/json

How was this patch tested?

  • Unit test has been added.
  • Unit tests of ambari-server have been run along with manual testing.
  • Parts HDP certification was run.

Tamas Payer added 5 commits June 4, 2019 13:59
…he content is JSON.

Ambari should not fail if the request is using 'Content-Type:application/json'
A filter overrides the 'application/json' content type to text/plain.

Change-Id: Ieb38e012c1a82f742343ecb8a539f73df457ba96
…he content is JSON.

If the Content-Type of the request is "application/json", the Content-Type of response
is changed to "application/json" from "text/plain".

Change-Id: Ic4bf567af4ce20132c4e66fb7e2dbcbab0806292
…he content is JSON.

Javadoc updated.

Change-Id: Icbda33e3e588c30b9bd4ab44b78bd2775db5e1b1
Change-Id: If618d57735fecf3381a50d9bc64d33610cf3260c
Change-Id: I15f144b6805bf6488be090424d0405b4b35874e0
@asfgit
Copy link
Copy Markdown

asfgit commented Jun 17, 2019

Refer to this link for build results (access rights to CI server needed):
https://builds.apache.org/job/Ambari-Github-PullRequest-Builder/5299/
Test FAILed.
Test FAILured.

@adoroszlai adoroszlai requested review from kasakrisz and zeroflag and removed request for adoroszlai June 17, 2019 18:16
Copy link
Copy Markdown
Contributor

@kasakrisz kasakrisz left a comment

Choose a reason for hiding this comment

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

LGTM

Change-Id: I98208f2be51aca904f8a33b00e2970eae53f4a98
@g-boros
Copy link
Copy Markdown
Contributor

g-boros commented Jun 18, 2019

@dlysnichenko @mpapirkovskyy @aonishuk can any of you pls review?

@asfgit
Copy link
Copy Markdown

asfgit commented Jun 18, 2019

Refer to this link for build results (access rights to CI server needed):
https://builds.apache.org/job/Ambari-Github-PullRequest-Builder/5304/
Test FAILed.
Test FAILured.

@payert
Copy link
Copy Markdown
Author

payert commented Jun 18, 2019

retest this please

@asfgit
Copy link
Copy Markdown

asfgit commented Jun 18, 2019

Refer to this link for build results (access rights to CI server needed):
https://builds.apache.org/job/Ambari-Github-PullRequest-Builder/5306/
Test PASSed.

Tamas Payer added 3 commits June 19, 2019 11:07
…class visibility.

- ContentTypeOverrideFilter was moved to java.org.apache.ambari.server.api package.
- Inner Response/Request wrapper classes visibility has changed to package-private
  to support unit testing.

Change-Id: I41e8aff8ac8c1782e812f84aa9e71c5e055521df
Change-Id: I89409ee22c3a1c44b51772407f851fb05d987bb0
Change-Id: Ib6c7d1430c67f1d839f19850d3736a366d2b481b
@asfgit
Copy link
Copy Markdown

asfgit commented Jun 19, 2019

Refer to this link for build results (access rights to CI server needed):
https://builds.apache.org/job/Ambari-Github-PullRequest-Builder/5320/
Test PASSed.

@kasakrisz kasakrisz merged commit beb2133 into apache:branch-2.7 Jun 21, 2019
@payert payert deleted the AMBARI-9016-branch-2.7 branch July 19, 2019 10:56
payert added a commit to payert/ambari that referenced this pull request Apr 16, 2020
…n the content is JSON. (apache#3015)

(cherry picked from commit beb2133)

Change-Id: I635cf79d14aa0c9dc671b3f12c6ea1740f7344da
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.

4 participants