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

Correct requests to api.perma.cc that don't specify a route #3174

Merged

Conversation

sabzo
Copy link
Contributor

@sabzo sabzo commented Sep 29, 2022

No description provided.

@sabzo sabzo requested a review from a team as a code owner September 29, 2022 19:52
@sabzo sabzo requested review from bensteinberg and removed request for a team September 29, 2022 19:52
@codecov
Copy link

codecov bot commented Sep 29, 2022

Codecov Report

Merging #3174 (d295c2e) into develop (20a824d) will increase coverage by 0.00%.
The diff coverage is 66.66%.

@@           Coverage Diff            @@
##           develop    #3174   +/-   ##
========================================
  Coverage    84.22%   84.22%           
========================================
  Files           52       52           
  Lines         5591     5592    +1     
========================================
+ Hits          4709     4710    +1     
  Misses         882      882           
Impacted Files Coverage Δ
perma_web/api/urls.py 78.94% <ø> (+3.94%) ⬆️
perma_web/api/views.py 85.46% <66.66%> (-0.29%) ⬇️

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

@sabzo
Copy link
Contributor Author

sabzo commented Sep 30, 2022

This ticket is ready to review :)

@sabzo
Copy link
Contributor Author

sabzo commented Sep 30, 2022

Are there unit tests to write for this feature?

Copy link
Contributor

@bensteinberg bensteinberg left a comment

Choose a reason for hiding this comment

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

These redirects are already working correctly, I think, or at least they do for me. What symptom or issue are you seeing that this PR addresses?

@sabzo sabzo marked this pull request as draft October 6, 2022 21:05
@sabzo
Copy link
Contributor Author

sabzo commented Oct 11, 2022

This PR tries to address the scenario where If a developer accidentally curl -X POST https://api.perma.cc/ (instead of POSTing to one of the actual API endpoints), our app tries to send them an HTML error page, but the error page itself throws a 500 error, because it only works for perma.cc routes, not api.perma.cc routes.

@sabzo sabzo requested a review from bensteinberg October 12, 2022 14:21
Copy link
Contributor

@bensteinberg bensteinberg left a comment

Choose a reason for hiding this comment

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

LGTM. Thanks!

@sabzo sabzo added the api Subcategory label Oct 12, 2022
@sabzo sabzo changed the title initial work to correct bad requests Correct requests to api.perma.cc that don't specify a route Oct 13, 2022
@sabzo sabzo marked this pull request as ready for review October 13, 2022 15:06
@sabzo sabzo merged commit caa5520 into harvard-lil:develop Oct 13, 2022
@sabzo sabzo deleted the feature/show_correct_error_for_bad_request branch October 13, 2022 15:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api Subcategory
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants