Skip to content

Conflicting addbook endpoints? #1163

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

Closed
mekarpeles opened this issue Sep 22, 2018 · 2 comments
Closed

Conflicting addbook endpoints? #1163

mekarpeles opened this issue Sep 22, 2018 · 2 comments
Assignees
Labels
Module: Import Issues related to the configuration or use of importbot and other bulk import systems. [managed]

Comments

@mekarpeles
Copy link
Member

mekarpeles commented Sep 22, 2018

Are plugins/upstream/addbook.py addbook and plugins/openlibrary/code.py addbook clobbering each other?

@mekarpeles mekarpeles changed the title plugins/upstream/addbook.py addbook and plugins/openlibrary/code.py addbook clobbering each other ? Are plugins/upstream/addbook.py addbook and plugins/openlibrary/code.py addbook clobbering each other ? Sep 22, 2018
@mekarpeles mekarpeles changed the title Are plugins/upstream/addbook.py addbook and plugins/openlibrary/code.py addbook clobbering each other ? Conflicting addbook endpoints? Sep 22, 2018
@hornc hornc added the Module: Import Issues related to the configuration or use of importbot and other bulk import systems. [managed] label Oct 2, 2018
@hornc
Copy link
Collaborator

hornc commented May 8, 2019

https://github.com/internetarchive/openlibrary/blob/master/openlibrary/plugins/upstream/addbook.py#L116

path = /books/add , is the UI add book page.

vs.

https://github.com/internetarchive/openlibrary/blob/master/openlibrary/plugins/openlibrary/code.py#L193

path = /addbook Looks like it deliberately redirects to /books/add -- what does it add?

curl -I https://openlibrary.org/addbook
HTTP/1.1 301 Moved Permanently
Server: nginx/1.4.6 (Ubuntu)
Date: Wed, 08 May 2019 10:44:59 GMT
Content-Type: text/html
Connection: keep-alive
Location: https://openlibrary.org/books/add
X-OL-Stats: ""

@hornc
Copy link
Collaborator

hornc commented Nov 7, 2019

The answer to this question is No, there is no path clobbering going on, the paths have different names, even though one redirects to the other. I'm not sure why there is a re-direct, probably for historical reasons, but I'm not aware of any cost to this. It could be refactored when someone is working on a specific feature in this area in future.

@hornc hornc closed this as completed Nov 7, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Module: Import Issues related to the configuration or use of importbot and other bulk import systems. [managed]
Projects
None yet
Development

No branches or pull requests

2 participants