Skip to content

Bug on parsing DID URLs with a path and fragment #14

@stevenvegt

Description

@stevenvegt

Expect this to succeed:

t.Run("ok - parse a DID URL", func(t *testing.T) {
    id, err := ParseDID("did:nuts:123/path#fragment")
    assert.NoError(t, err)
    assert.Equal(t, "did:nuts:123/path#fragment", id.String())
})

Get this instead:

=== RUN   TestParseDIDURL/ok_-_parse_a_DID_URL
    did_test.go:86: 
        	Error Trace:	did_test.go:86
        	Error:      	Received unexpected error:
        	            	character is not allowed in path
        	Test:       	TestParseDIDURL/ok_-_parse_a_DID_URL

It seems that this fails when there is a path present, but no query between path and the fragment.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions