[RFE] Stop special handling of mime extensions in the API

Bug #1748224 reported by Dmitry Tantsur
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Ironic
Fix Released
Wishlist
Afonne-CID

Bug Description

Previously we treated things like /v1/nodes/test.1 as node with name "test" returned as man page. This obvious misbehavior was fixed in https://bugs.launchpad.net/ironic/+bug/1643995. However, we still treat /v1/nodes/test.json as node "test" if it exists and only fall back to node "test.json" if it does not.

This RFE suggests introducing an API version where any special treatment of .json is disabled in the API. So, in this version /v1/nodes/test.json will only mean node with name "test.json", and /v1/nodes.json will be HTTP 404.

Revision history for this message
Ruby Loo (rloo) wrote :

Thanks for reporting this Dmitry. I'm good with approving it.

Revision history for this message
Vladyslav Drok (vdrok) wrote :

+1, don't think spec is needed here.

Revision history for this message
Ruby Loo (rloo) wrote :

jlvillal and TheJulia are good with approving this w/o a spec.

tags: added: rfe-approved
removed: rfe
Nisha Yadav (ynisha11)
Changed in ironic:
assignee: nobody → Nisha Yadav (ynisha11)
Changed in ironic:
assignee: Nisha Yadav (ynisha11) → nobody
Afonne-CID (cidelight)
Changed in ironic:
assignee: nobody → Afonne-CID (cidelight)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to ironic (master)

Fix proposed to branch: master
Review: https://review.opendev.org/c/openstack/ironic/+/913467

Changed in ironic:
status: Confirmed → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to ironic (master)

Reviewed: https://review.opendev.org/c/openstack/ironic/+/913467
Committed: https://opendev.org/openstack/ironic/commit/ee5315bcf3364469d5d5200933ab22e1ecdc38c2
Submitter: "Zuul (22348)"
Branch: master

commit ee5315bcf3364469d5d5200933ab22e1ecdc38c2
Author: cid <email address hidden>
Date: Fri Apr 19 03:56:41 2024 +0100

    Remove special treatment of .json for API objects

    - /v1/nodes/test.json will now only mean node with the name
    "test.json"
    - /v1/nodes/test.json.json will mean a node with the name
    "test.json.json" and,
    - /v1/nodes/test will mean a node with the name "test".

    So /v1/nodes/test.json will no longer default to "test" and
    will HTTP 404 unless a node with the name "test" actually exists.

    This also removes the backward compatibility with the
    guess_content_type_from_ext feature

    Closes-Bug: #1748224

    Change-Id: If4b3a23e2a09065f5e063e66cff66b96af4d3393

Changed in ironic:
status: In Progress → Fix Released
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/ironic 25.0.0

This issue was fixed in the openstack/ironic 25.0.0 release.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.