Skip to content

Remove max url length from authenticate flow #2841

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

Open
wants to merge 5 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"type": "patch",
"comment": "Removed the max length validation from the `authentication.authenticate` API.",
"packageName": "@microsoft/teams-js",
"email": "[email protected]",
"dependentChangeType": "patch"
}
3 changes: 0 additions & 3 deletions packages/teams-js/src/internal/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -427,9 +427,6 @@ export function validateUrl(url: URL, errorToThrow?: Error): void {
if (hasScriptTags(urlString)) {
throw errorToThrow || new Error('Invalid Url');
}
if (urlString.length > 2048) {
throw errorToThrow || new Error('Url exceeds the maximum size of 2048 characters');
}
if (!isValidHttpsURL(url)) {
throw errorToThrow || new Error('Url should be a valid https url');
}
Expand Down
9 changes: 0 additions & 9 deletions packages/teams-js/test/internal/utils.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -268,15 +268,6 @@ describe('utils', () => {
expect(error).toEqual(new Error('Invalid Url'));
}
});
it('should throw maxlength exceed error if it contains more than 2048 chars', async () => {
expect.assertions(1);
const url = 'https://example.com?param=' + 'a'.repeat(2048);
try {
validateUrl(new URL(url));
} catch (error) {
expect(error).toEqual(new Error('Url exceeds the maximum size of 2048 characters'));
}
});
it('should throw invalid url error if it non http url', async () => {
expect.assertions(1);
// eslint-disable-next-line @microsoft/sdl/no-insecure-url
Expand Down
Loading