Skip to content
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

Redirects with same method instead of GET in Thunder Client #388

Closed
Pawper opened this issue Nov 8, 2021 · 4 comments
Closed

Redirects with same method instead of GET in Thunder Client #388

Pawper opened this issue Nov 8, 2021 · 4 comments
Labels
bug Something isn't working Priority Implement this asap

Comments

@Pawper
Copy link

Pawper commented Nov 8, 2021

Describe the bug
Hello! I have a form POST route set up in an Express app. The route has a redirect. In the browser, this works as expected (redirect has method of GET). When I submit to the route with ThunderClient, the redirect is with a method of POST. I am not sure why...

To Reproduce
Express route (note the redirect):

app.post('/campgrounds/:id/reviews', validateReview, catchAsync(async (req, res) => {
    console.log("REVIEW POSTED!!!")
    const campground = await Campground.findById(req.params.id);
    const review = new Review(req.body.review);
    campground.reviews.push(review);
    await review.save();
    await campground.save();
    res.redirect(`/campgrounds/${campground._id}`);
}))

Thunder Client:
image

Form (EJS):

            <form action="/campgrounds/<%= campground._id %>/reviews" method="POST">
                <div>
                    <label for="rating">Rating</label>
                    <input class="form-range" type="range" min="1" max="5" name="review[rating]" id="rating">
                </div>
                <div class="mb-3">
                    <label for="body">Review</label>
                    <textarea name="review[body]" id="body" cols="30" rows="3" required></textarea>
                </div>
                <button>Submit</button>
            </form>

Expected behavior
Using morgan - this is what I get when submitting from the form on the web page:
image
Instead I get this with Thunder Client:
image

Platform:
Visual Studio Code - Insiders

Version: 1.63.0-insider (user setup)
Commit: 552af97a0170b43c9323bec62211feb184da9749
Date: 2021-11-05T05:16:20.583Z (3 days ago)
Electron: 13.5.1
Chrome: 91.0.4472.164
Node.js: 14.16.0
V8: 9.1.269.39-electron.0
OS: Windows_NT x64 10.0.19042

  • extension version: 1.9.1
@rangav
Copy link
Collaborator

rangav commented Nov 8, 2021

Hi @Pawper thanks for reporting the issue

@rangav rangav added bug Something isn't working Priority Implement this asap labels Jan 17, 2022
@rangav
Copy link
Collaborator

rangav commented Jan 26, 2022

This issue is now fixed in v1.11.0
https://github.com/rangav/thunder-client-support/releases/tag/v1.11.0

please let me know if any feedback

@rangav rangav closed this as completed Jan 26, 2022
@me-nkr
Copy link

me-nkr commented Mar 5, 2022

issue persists in v1.12.2

@rangav
Copy link
Collaborator

rangav commented Mar 5, 2022

Hi @me-nkr can you share more details of the issue you are facing and any screenshots

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working Priority Implement this asap
Projects
None yet
Development

No branches or pull requests

3 participants