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
Make some normalized options enumerable #1067
Comments
I agree. We should whitelist some known-to-be-safe properties. |
This also applies to |
@szmarczak Do you have any thoughts on what a solution might look like here? The quirk from my own usage with I recognise that this is documented right at the top of the README under Usage, but it'd be nice if the default behaviour would log usable error content. |
Closing in favor of #1353 |
Got errors have an options property which is not enumerable:
got/source/errors.ts
Line 23 in 1d012a5
This was introduced because of a security issue: #754
But the chosen solution is not good for all cases. This means that in a service that does many requests it's impossible to know where the error comes from unless remembering to do manual exception wrapping in all places http requests are initiated:
Without it I get errors like this in logs which are useless:
I think this needs to be improved. For example one solution would be to have a default list of properties paths that should not be enumerable (ex. headers.Authorization) that can be overwritten by the user.
The very least would be to make the url, method and status code enumerable.
The text was updated successfully, but these errors were encountered: