alexandrehtrb / Pororoca

An HTTP inspection tool with support for HTTP/2 and HTTP/3. Alternative to Postman.

Home Page:https://pororoca.io

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Highlight validation fields with problems of client certificate auth

alexandrehtrb opened this issue · comments

We could highlight fields with validation problems of client certificate auth. We are already doing this with URL, HTTP version and some request body fields.

This needs to be done for HttpRequest and WebSocketConnection.

Relevant ViewModel code:

HasRequestUrlValidationProblem = (errorCode == TranslateRequestErrors.InvalidUrl);
HasRequestHttpVersionValidationProblem =
(errorCode == TranslateRequestErrors.Http2UnavailableInOSVersion || errorCode == TranslateRequestErrors.Http3UnavailableInOSVersion);
HasRequestRawContentTypeValidationProblem =
(errorCode == TranslateRequestErrors.ContentTypeCannotBeBlankReqBodyRaw || errorCode == TranslateRequestErrors.InvalidContentTypeRaw);
HasRequestFileContentTypeValidationProblem =
(errorCode == TranslateRequestErrors.ContentTypeCannotBeBlankReqBodyFile || errorCode == TranslateRequestErrors.InvalidContentTypeFile);
HasRequestBodyFileSrcPathValidationProblem = (errorCode == TranslateRequestErrors.ReqBodyFileNotFound);
if (HasRequestRawContentTypeValidationProblem
|| HasRequestFileContentTypeValidationProblem
|| HasRequestBodyFileSrcPathValidationProblem)
{
// TODO: Improve this, do not use fixed values to resolve index
RequestTabsSelectedIndex = 1;
}

The highlight appears when the VM property is true:

Classes.HasValidationProblem="{Binding HasRequestUrlValidationProblem}"

Done, will be published in next release