Skip to content

Added refit setting to bypass url verification - #1113

Closed
mjfara wants to merge 5 commits into
reactiveui:mainfrom
mjfara:main
Closed

mjfara wants to merge 5 commits into
reactiveui:mainfrom
mjfara:main

Conversation

@mjfara

@mjfara mjfara commented Mar 10, 2021

Copy link
Copy Markdown

Feature
Added a new Refit Setting to allow bypassing of Url verification, specifically for use in a generic class for the Microsoft Dynamics Web API which uses OData.

What is the current behavior?
The current behavior enforces the url verification:

VerifyUrlPathIsSane(RelativePath);

static void VerifyUrlPathIsSane(string relativePath)
        {
            if (relativePath == "")
                return;

            if (!relativePath.StartsWith("/"))
                throw new ArgumentException($"URL path {relativePath} must start with '/' and be of the form '/foo/bar/baz'");
        }

What is the new behavior?
The new behavior adds an option to bypass this check:

if(refitSettings?.BypassUrlVerification != true)
                VerifyUrlPathIsSane(RelativePath);

What might this PR break?
This PR should have no effect on anything else, as the default behavior without changing this option is the same.

@mjfara

mjfara commented Mar 10, 2021 •

Copy link
Copy Markdown
Author

Issue: #1105

@clairernovotny

Copy link
Copy Markdown
Member

As mentioned in #1105 (comment), we won't be taking this change at this time. A custom delegating HttpHandler can alter the URL's as needed.

@github-actions

Copy link
Copy Markdown

This pull request has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@github-actions github-actions Bot locked as resolved and limited conversation to collaborators Apr 13, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants