This post has been de-listed
It is no longer included in search results and normal feeds (front page, hot posts, subreddit posts, etc). It remains visible only via the author's post history.
Hi,
Two years ago I created a webpage to provide a UI to edit custom feeds, it uses oauth2 authentication flow and calls https://www.reddit.com/dev/api#PUT_api_multi_{multipath} API. Back then it worked without a problem.
Recently a GitHub issue was created that says the webpage is not working anymore: when you try to edit your custom feed it returns a CORS error:
... has been blocked by CORS policy: Method PUT is not allowed by Access-Control-Allow-Methods in preflight response.
n was searching for a solution in other GitHub projects I found none. However, I found projects that also have the very same problem of not being able to edit custom feeds due to CORS (and probably they were tested back when the feature was added):
in my project the following code causes the error:
public async updateMulti(
multiPath: string,
subreddits: { name: string }[],
accessToken: string
): Promise<void> {
const axiosInstance = axios.create({
baseURL: "https://oauth.reddit.com",
timeout: 5000,
headers: {
"Content-Type": "application/x-www-form-urlencoded",
Authorization: "bearer " accessToken,
},
});
return axiosInstance.put(
`/api/multi${multiPath}`,
{},
{
params: {
model: {
subreddits: subreddits,
},
},
}
);
}
Could you please tell me what has changed on the Reddit API side in the last 2 years that my webpage should be updated according to?
Subreddit
Post Details
- Posted
- 1 year ago
- Reddit URL
- View post on reddit.com
- External URL
- reddit.com/r/redditdev/c...