Skip to content

Relative path fix#171

Merged
sergey-tihon merged 2 commits intofsprojects:masterfrom
xperiandri:relative-path-fix
Dec 13, 2020
Merged

Relative path fix#171
sergey-tihon merged 2 commits intofsprojects:masterfrom
xperiandri:relative-path-fix

Conversation

@xperiandri
Copy link
Copy Markdown
Contributor

Fixed relative path resolution, added support for FTP scheme

| false ->
use sr = new System.IO.StreamReader(schemaPathRaw)
| _ ->
let request = WebRequest.Create(schemaPathRaw)
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@xperiandri why do you use WebRequest to load file content from hard drive?

Copy link
Copy Markdown
Contributor Author

@xperiandri xperiandri Dec 13, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Because it is universal and can handle FTP and whatever other protocol you want and register.
File and FTP includes out of the box


let readSchemaPath (headersStr:string) (schemaPathRaw:string) =
async {
match schemaPathRaw.StartsWith("http", true, null) with
Copy link
Copy Markdown
Member

@sergey-tihon sergey-tihon Dec 13, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

previously this condition worked like if it start with http (so this is url, http or https) then we load using HTTP request otherwise load local file from file system

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agree, missed this point. I'll fix

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed

@sergey-tihon sergey-tihon merged commit a7149fe into fsprojects:master Dec 13, 2020
@sergey-tihon
Copy link
Copy Markdown
Member

Thank you for this fix @xperiandri !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants