-
Notifications
You must be signed in to change notification settings - Fork 98
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: wrong uri format in location header #144
base: next
Are you sure you want to change the base?
fix: wrong uri format in location header #144
Conversation
Hi @Alonza0314 , From #71 ,
Do we need to change the other NF's code? |
Yes, I have told amf to modify in r17.👍 |
6d1c92b
to
3b8b2b4
Compare
3b8b2b4
to
a1d09e2
Compare
LGTM. |
protocol, | ||
c.Request.Host, | ||
strings.TrimSuffix(c.Request.URL.Path, "/"), | ||
strings.Split(smContext.Ref, ":")[2]) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should add the length check to avoid the invalid memory access.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this check appears to be redundant for two reasons:
- During UUID creation, the Must() function already ensures its validity by panicking if the creation fails.
- In the formatting part, the code:
copy(buf[:], "urn:uuid:")
encodeHex(buf[9:], uuid)
guarantees that the format will always be urn:uuid:xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx.
Therefore, an additional length check at here is unnecessary as the format is enforced by the implementation itself.
By the way, I still can add a double check at here. Do you think we need it?😆
This PR fix the problem in issue #71.
Before:
![Screenshot 2025-01-14 at 12 07 19 AM](https://private-user-images.githubusercontent.com/102594269/402931735-f357844c-349c-464b-9ffa-9a25930b39b7.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3Mzk1NTMyNDIsIm5iZiI6MTczOTU1Mjk0MiwicGF0aCI6Ii8xMDI1OTQyNjkvNDAyOTMxNzM1LWYzNTc4NDRjLTM0OWMtNDY0Yi05ZmZh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