Profile Image Update Bug: 404 Error When Saving Without Uploading a New File

Updating profile images happens to be buggy.

With referring profile image edit page (Sign In | Ministry of Testing), a POST request to https://www.ministryoftesting.com/profile/ramanan49/profile_image is generated when trying to save profile settings, which fails with a 404 Status Code-Not Found.

This occurs when the user clicks on the Save button without selecting or uploading any new image file, wherein an error should appear.

This request carries a Content-Type: multipart/form-data header, meaning that some form data were intended to be transmitted, although no file has been selected. A 404 status implies that the server endpoint for this URL and method combination (POST to /profile/:username/profile_image) cannot be found or does not handle this particular scenario (for example, when no file data is present in the request body).

Steps to Reproduce:

• Start out at the profile image edit page (e.g., Sign In | Ministry of Testing).

• Do not select or upload a new image file.

• Click on Save/Update.

• Observe the failure of the network requests from developer tools of the browser.

Expected Behavior:

The request should either not be made, or the server should handle it gracefully, for example, return a 200 OK just in case nothing is changed, or a relevant status code if no image was uploaded and that is a valid state, rather than a 404.

Actual Behavior:

A POST is sent to, https://www.ministryoftesting.com/profile/YOUR_USERNAME/profile_image and a 404 Not Found is received.

Unless on the page, image is being changed, the user is not supposed to save the profile setting. This may shed light upon either of the two: a flaw with form submission or server-side routing logic for the image update.

Refer to the screenshot attached.

Please let me know if you need any further details.

Thanks,

Ramanan

1 Like