-
Notifications
You must be signed in to change notification settings - Fork 3
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 signed url #7
Conversation
if !cmp.Equal(tr, expectedTr) { | ||
t.Errorf("url: %s, expected tr: %s\ngot tr: %s", tc.url, expectedTr, tr) | ||
} | ||
if !urlsEquals(url, tc.url) { |
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.
There was only an assertion for URLs containing tr:
inside the path, so
here added an assertion that will test all the URLs.
} | ||
}) | ||
} | ||
|
||
} | ||
|
||
func extractTransformation(t *testing.T, url string) (urlResult string, trResult []string) { |
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 removed this because it was not needed anymore. This function removes transformations from the path and checks whether they exist in the URL. Now, we are directly matching URLs.
This was needed earlier because the sequence of transformation was not fixed earlier refer here
LGTM. |
@@ -76,6 +73,43 @@ func TestUrl(t *testing.T) { | |||
}, | |||
url: "https://ik.imagekit.io/test/default-image.jpg?ik-t=1653775928&ik-s=48842eca663c6895331331db6c90f262c601f4e8", | |||
}, { | |||
name: "signed-url-with-transformation", |
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.
can we add a test case for signed url without expiry
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.
done added a test case for signed URL without expiry
LGTM |
https://www.loom.com/share/3af1e2e44f8c455592ed902cfcbc9272?sid=fc11605a-39b4-45cc-b0b5-3206b6dfa0a6