mirror of
https://github.com/superseriousbusiness/gotosocial
synced 2025-06-05 21:59:39 +02:00
[bugfix] Use punycode for host
part of resource
query param when doing webfinger requests (#3133)
* [bugfix] use punycode when webfingering * account for punycode when checking if final URI matches expected * hmm * fix test
This commit is contained in:
@@ -467,13 +467,26 @@ func (d *Dereferencer) enrichStatus(
|
||||
)
|
||||
}
|
||||
|
||||
// Ensure the final parsed status URI / URL matches
|
||||
// Ensure the final parsed status URI or URL matches
|
||||
// the input URI we fetched (or received) it as.
|
||||
if expect := uri.String(); latestStatus.URI != expect &&
|
||||
latestStatus.URL != expect {
|
||||
matches, err := util.URIMatches(
|
||||
uri,
|
||||
append(
|
||||
ap.GetURL(apubStatus), // status URL(s)
|
||||
ap.GetJSONLDId(apubStatus), // status URI
|
||||
)...,
|
||||
)
|
||||
if err != nil {
|
||||
return nil, nil, gtserror.Newf(
|
||||
"error checking dereferenced status uri %s: %w",
|
||||
latestStatus.URI, err,
|
||||
)
|
||||
}
|
||||
|
||||
if !matches {
|
||||
return nil, nil, gtserror.Newf(
|
||||
"dereferenced status uri %s does not match %s",
|
||||
latestStatus.URI, expect,
|
||||
latestStatus.URI, uri.String(),
|
||||
)
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user