Repository navigation
Resolves Issue #344: Only send InternalServerError when needed - #354
Conversation
|
As a note to reviewers, InternalServerError is commonly intercepted by proxies and CDNs as indication that they should intervene, so this patch's purpose is to use it that way. |
There was a problem hiding this comment.
As far as I can tell by this point we have checked all the fields which constitute the Authorization object we construct so the only errors returned should be internal SQL transaction ones, the full body of which we may not want to pass back to the user?
There was a problem hiding this comment.
Agreed. By using MalformedRequestError we are stating to the WFE that the error is safe to pass to the user. So we should probably replace this with a specific string (and log the error). There are a couple of other instances below.
|
All of the |
There was a problem hiding this comment.
Side note net.LookupMX can return underlying transport errors not caused by the user, it can be checked for type *net.DNSError to see the internal error (no host/timeout/server issues/etc) but this probably isn't 100% necessary.
|
So looking through the RA again, @rolandshoemaker and @jsha , I changed about everything back to InternalServerError, and also saw that the reasoning -- that inputs were validated -- was untrue for UpdateRegistration. It turns out while on NewRegistration we make sure your contact info is acceptable, we do nothing on Update. So I tossed that in there too. |
Basically, just send InternalServerError when it indicates an internal state was broken.
222f930 to
2d79af0
Compare
|
LGTM, good call on |
|
eh, I should pull that into a method. I'll do that real quick and submit another commit. |
- Created a `validateContacts` method to avoid duplicated code - Added tests for `validateContacts` and `validateEmail` - Fix error formatting in `validateEmail`: Discovered while testing `validateEmail` that, if no MX records are found, `err` is returned, not an empty array. As such, the error message was misleading, so I consoldated the conditions into one.
|
Refactor + tests look good, merging. |
Resolves Issue #344: Only send InternalServerError when needed
Basically, just send InternalServerError when it indicates an internal state
was broken.