Page MenuHomeSoftware Heritage

common/service: Handle trailing url slashes in lookup_origin
ClosedPublic

Authored by anlambert on Feb 18 2020, 2:01 PM.

Details

Summary

It will enable to find an origin when users provide urls with or without a trailing slash.

Related to T1852
Related to T2289

Diff Detail

Repository
rDWAPPS Web applications
Branch
lookup-origin-trailing-slash
Lint
No Linters Available
Unit
No Unit Test Coverage
Build Status
Buildable 10668
Build 15990: Cypress tests for swh-web diffsJenkins
Build 15989: tox-on-jenkinsJenkins
Build 15988: arc lint + arc unit

Event Timeline

vlorentz added a subscriber: vlorentz.
vlorentz added inline comments.
swh/web/common/service.py
235

at this point, len(origins) is 3.

With either the URL missing the last character, or two slashes at the end.

This revision now requires changes to proceed.Feb 18 2020, 2:09 PM

Update: Check extra origin urls only when required

Update: Improve implementation (use endswith + if/else)

This revision is now accepted and ready to land.Feb 18 2020, 4:25 PM
This revision was landed with ongoing or failed builds.Feb 18 2020, 4:47 PM
This revision was automatically updated to reflect the committed changes.