Skip to content

Commit

Permalink
fix(sanitize-project): listprojects.json accepts no parameters. proje…
Browse files Browse the repository at this point in the history
…ct is not required for listjobs.json.
  • Loading branch information
jpmckinney committed Jul 17, 2024
1 parent 0f45e31 commit e86d261
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions scrapyd/webservice.py
Original file line number Diff line number Diff line change
Expand Up @@ -160,8 +160,7 @@ def render_POST(self, txrequest, project):


class ListProjects(WsResource):
@with_safe_project_name
def render_GET(self, txrequest, project):
def render_GET(self, txrequest):
projects = list(self.root.scheduler.list_projects())
return {"node_name": self.root.nodename, "status": "ok",
"projects": projects}
Expand Down Expand Up @@ -217,8 +216,10 @@ def render_GET(self, txrequest):


class ListJobs(WsResource):
@with_safe_project_name
def render_GET(self, txrequest, project):
def render_GET(self, txrequest):
args = native_stringify_dict(copy(txrequest.args), keys_only=False)
project = args.get('project', [None])[0]

spiders = self.root.launcher.processes.values()
queues = self.root.poller.queues

Expand Down

0 comments on commit e86d261

Please sign in to comment.