Skip to content

False negatives with Url.IsValid #462

Description

@tomasr78

The SetQueryParam method produces "Cannot create a Request. Neither BaseUrl nor the first segment passed is a valid URL. " exception on some strings like

var uri = "http://myhost.com/upload".SetQueryParam("name", "Dedant-Simon - ELR & Hollange - IPESS Ougrée pg.2.jpg")

The exception is throw on POST

        using (var client = new FlurlClient(uri))
        {
            fileUploadResultDto = client.Request()
                .WithHeader("accept", "application/json")
                .PostMultipartAsync(p =>
                {
                    var fileStream = file.OpenRead();
                    p.AddFile(fileName, fileStream, fileName, GetMimeType(Path.GetExtension(fileName)));
                })
                .ReceiveJson<FileUploadResultDto>().Result;
        }

If I replace the string "Dedant-Simon - ELR & Hollange - IPESS Ougrée pg.2.jpg" with simple one everything works fine.

Metadata

Metadata

Assignees

No one assigned

    Projects

    Status
    Released

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions