-
Notifications
You must be signed in to change notification settings - Fork 38
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
AssertionError [ERR_ASSERTION]: protocol mismatch #9
Comments
I am seeing the same thing:
I think the issue is the shortened link - it's http://, not https://. Doing a find and replace http -> https in data/tweets.js helped a bit, but I still failed out a little later with a different error:
|
@Jay2645 they should be two different problems, for the http url resolution problem I made a branch with a possible fix https://github.com/marcomaroni-github/twitter-to-bluesky/tree/9-assertion-protocol-mismatch, @Jay2645 @iznaut try it and tell me if it solves the "protocol mismatch" problem |
@marcomaroni-github I was going to submit a PR, but I see that you're already working on it. I resolved this in the I first imported both import { https, http } from 'follow-redirects'; async function resolveShorURL(url: string): Promise<string> {
const isHttp = url.startsWith("http://");
return new Promise<string>((resolve, reject) => {
if (isHttp) {
http.get(url, response => {
resolve(response.responseUrl);
}).on('error', err => {
console.warn(`Error parsing url ${url}`);
resolve(url);
});
} else {
https.get(url, response => {
resolve(response.responseUrl);
}).on('error', err => {
console.warn(`Error parsing url ${url}`);
resolve(url);
});
}
});
} |
@paceaux yes, your solution is very similar to mine, you can check it into the branch https://github.com/marcomaroni-github/twitter-to-bluesky/tree/9-assertion-protocol-mismatch |
@marcomaroni-github Nice. Not that my opinion matters but... ¿approved? |
branch worked for a while, but died on a different issue (see #11 ) great work though! |
Based on what I can tell from the log, it looks like it's failing on this tweet since it's the last one (and doesn't get posted to Bluesky:
The text was updated successfully, but these errors were encountered: