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

changed response type of API to application/JSON #948

Merged
merged 3 commits into from
Feb 17, 2023

Conversation

pgrudra
Copy link
Collaborator

@pgrudra pgrudra commented Feb 15, 2023

PR for issue: #883

// Helper handlers

// Error replies to the request with the specified error message and HTTP code.
// It does not otherwise end the request; the caller should ensure no further
// writes are done to w.
// The error message should be plain text.
func Error(w ResponseWriter, error string, code int) {
	w.Header().Set("Content-Type", "text/plain; charset=utf-8")
	w.Header().Set("X-Content-Type-Options", "nosniff")
	w.WriteHeader(code)
	fmt.Fprintln(w, error)
}

Removed use of inbuilt function http.Error()
Screenshot 2023-02-16 at 3 45 18 AM
Screenshot of response after merging PR attached.

@codecov-commenter
Copy link

Codecov Report

Merging #948 (360a47f) into staging (b064087) will not change coverage.
The diff coverage is n/a.

📣 This organization is not using Codecov’s GitHub App Integration. We recommend you install it so Codecov can continue to function properly for your repositories. Learn more

@@           Coverage Diff            @@
##           staging     #948   +/-   ##
========================================
  Coverage    26.63%   26.63%           
========================================
  Files           76       76           
  Lines         7648     7648           
========================================
  Hits          2037     2037           
  Misses        5345     5345           
  Partials       266      266           
Flag Coverage Δ
Unit-Tests 26.63% <ø> (ø)

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

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

@service-0chain
Copy link
Collaborator

Manual system tests [failure] with the following config

config value
tests skipped FALSE
system-tests master
gosdk NOT OVERRIDDEN
zboxcli staging
zwalletcli staging
0chain staging
blobber test_response_for_error
authorizer staging
0box staging
0block staging
0dns staging
explorer master
0proxy staging
0search staging

Copy link
Member

@peterlimg peterlimg left a comment

Choose a reason for hiding this comment

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

LGTM

@peterlimg
Copy link
Member

@din-mukhammed please fix the system test errors, search re-run 2 in the failed cases, and see what happened.

@dabasov dabasov linked an issue Feb 16, 2023 that may be closed by this pull request
@dabasov
Copy link
Member

dabasov commented Feb 16, 2023

@pgrudra @peterlimg please pay attention that appropriate issue is attached to the PR

@peterlimg
Copy link
Member

All failed cases in system tests are known cases that are not related to the changes, I'll mark it as pass.

@service-0chain
Copy link
Collaborator

Manual system tests [success] with the following config

config value
tests skipped TRUE
system-tests master
gosdk NOT OVERRIDDEN
zboxcli staging
zwalletcli staging
0chain staging
blobber test_response_for_error
authorizer staging
0box staging
0block staging
0dns staging
explorer master
0proxy staging
0search staging

@peterlimg peterlimg merged commit 44922e6 into staging Feb 17, 2023
@boddumanohar boddumanohar deleted the test_response_for_error branch February 17, 2023 07:55
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.

Content-Type should be application/json for blobber REST APIs
5 participants