We are rewriting an old integration with a service from python to golang. This service uses Custom status codes. For example the status code is 8000. But while I am trying to get the response it is giving me error as “malformed HTTP status code”. Can some one help me to resolve this issue. Gone through the code and found the following piece of code that throws the error if the status code is not having length of 3.
if len(statusCode) != 3 {
return nil, &badStringError{"malformed HTTP status code", statusCode}
}
EDIT: I do understand the RFC standard for HTTP status is 3 digits. But I am re-integrating a legacy code of a Banking system. So I cannot / dont have the access to change the service's implementation.
To give more context, python's http library was not doing this validation. (I am not saying that One language is superior to another, so please dont compare the languages/libraries) So wondering if there is any way to bypass this particular validation. Thanks in advance for understanding..