Skip to content

Commit

Permalink
Fix Basic Authorization header
Browse files Browse the repository at this point in the history
  • Loading branch information
ElfSundae authored and nlutsenko committed Jun 22, 2023
1 parent 6f61b54 commit 6fdc5fd
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions SocketRocket/Internal/Utilities/SRURLUtilities.m
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,10 @@ extern BOOL SRURLRequiresSSL(NSURL *url)

extern NSString *_Nullable SRBasicAuthorizationHeaderFromURL(NSURL *url)
{
if (!url.user || !url.password) {
return nil;
}

NSData *data = [[NSString stringWithFormat:@"%@:%@", url.user, url.password] dataUsingEncoding:NSUTF8StringEncoding];
return [NSString stringWithFormat:@"Basic %@", SRBase64EncodedStringFromData(data)];
}
Expand Down

2 comments on commit 6fdc5fd

@billnbell
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we get this released ?

@cipolleschi
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We are working on the release.
The internal version of SocketRocket and the one published in the OSS diverged, unfortunately. So, before proceeding with a release, we need to realign them.
Anyway, it will be available soon.

Please sign in to comment.