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

Return 404 responses for 'absent' items [RHELDST-9952] #320

Merged
merged 1 commit into from
Feb 15, 2022

Conversation

dichn
Copy link
Collaborator

@dichn dichn commented Feb 14, 2022

In order to support the explicit deletion/hiding of content on
exodus-cdn, it should make exodus-lambda return 404 responses for URIs
which have been marked as absent.

@dichn dichn marked this pull request as draft February 14, 2022 08:25
@dichn dichn marked this pull request as ready for review February 14, 2022 08:31
negillett
negillett previously approved these changes Feb 14, 2022
Copy link
Member

@crungehottman crungehottman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this patch is missing an integration test for an item with object_key == 'absent'

if object_key == "absent":
self.logger.info("Item absent for '%s'", uri)
return {"status": "404", "statusDescription": "Not Found"}
else:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can the "else" please be dropped to reduce unnecessary nesting?

It has no effect since the "if" case always returns. It's also arbitrary that you put only one line of code in it. Every line of code between here and "return request" should execute only in the "item found" case, what's special about this one line of code which makes sense for it to be in "else" and not any of the others?

In order to support the explicit deletion/hiding of content on
exodus-cdn, it should make exodus-lambda return 404 responses for URIs
which have been marked as absent.
@dichn dichn merged commit efb72b5 into release-engineering:master Feb 15, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants