This pull request introduces a new function to resolve short links (fixes#910) and integrates it into the existing Reddit comment fetching logic. The most significant changes include adding a new helper function and modifying the main export function to handle short links.
Enhancements to URL resolution:
api/src/processing/services/reddit.js: Added the resolveShortLink function to handle the resolution of short links using a HEAD request and manual redirection.
Improvements to main function:
api/src/processing/services/reddit.js: Modified the default export function to check for a short link and use the new resolveShortLink function. If a short link is provided and cannot be resolved, it returns an error. Otherwise, it constructs the URL based on the subreddit or user comment path.
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.
## 📋 Pull Request Information
**Original PR:** https://github.com/imputnet/cobalt/pull/950
**Author:** [@Aholicknight](https://github.com/Aholicknight)
**Created:** 11/26/2024
**Status:** ❌ Closed
**Base:** `main` ← **Head:** `short-link-reddit-support`
---
### 📝 Commits (4)
- [`eb5ac70`](https://github.com/imputnet/cobalt/commit/eb5ac709ab3d98e8dcf37795fdef9ec068e87516) api/reddit: add support for resolving short links in comments
- [`589e96e`](https://github.com/imputnet/cobalt/commit/589e96eb4a601e5ed6a18246a0ffcd78ecc1ffc1) fix await error on deepsource
- [`41296b7`](https://github.com/imputnet/cobalt/commit/41296b7413d1a8538b366decbcdee9047e4d4822) api/reddit: refactor short link resolution to use utility function
- [`e775d4c`](https://github.com/imputnet/cobalt/commit/e775d4c5e705146aa7de923e78be366e84bc78d4) Remove resolveShortLink function
### 📊 Changes
**1 file changed** (+14 additions, -5 deletions)
<details>
<summary>View changed files</summary>
📝 `api/src/processing/services/reddit.js` (+14 -5)
</details>
### 📄 Description
This pull request introduces a new function to resolve short links (fixes #910) and integrates it into the existing Reddit comment fetching logic. The most significant changes include adding a new helper function and modifying the main export function to handle short links.
**Enhancements** to URL resolution:
* [`api/src/processing/services/reddit.js`](diffhunk://#diff-9d3ca2025c5ab39b8e96df420e3b9ed3ab318b0cc93e95b632f959b46ac67a3aL50-R68): Added the `resolveShortLink` function to handle the resolution of short links using a `HEAD` request and manual redirection.
**Improvements** to main function:
* [`api/src/processing/services/reddit.js`](diffhunk://#diff-9d3ca2025c5ab39b8e96df420e3b9ed3ab318b0cc93e95b632f959b46ac67a3aL50-R68): Modified the default export function to check for a short link and use the new `resolveShortLink` function. If a short link is provided and cannot be resolved, it returns an error. Otherwise, it constructs the URL based on the subreddit or user comment path.
---
<sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
📋 Pull Request Information
Original PR: https://github.com/imputnet/cobalt/pull/950
Author: @Aholicknight
Created: 11/26/2024
Status: ❌ Closed
Base:
main← Head:short-link-reddit-support📝 Commits (4)
eb5ac70api/reddit: add support for resolving short links in comments589e96efix await error on deepsource41296b7api/reddit: refactor short link resolution to use utility functione775d4cRemove resolveShortLink function📊 Changes
1 file changed (+14 additions, -5 deletions)
View changed files
📝
api/src/processing/services/reddit.js(+14 -5)📄 Description
This pull request introduces a new function to resolve short links (fixes #910) and integrates it into the existing Reddit comment fetching logic. The most significant changes include adding a new helper function and modifying the main export function to handle short links.
Enhancements to URL resolution:
api/src/processing/services/reddit.js: Added theresolveShortLinkfunction to handle the resolution of short links using aHEADrequest and manual redirection.Improvements to main function:
api/src/processing/services/reddit.js: Modified the default export function to check for a short link and use the newresolveShortLinkfunction. If a short link is provided and cannot be resolved, it returns an error. Otherwise, it constructs the URL based on the subreddit or user comment path.🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.