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

Filedownloads url - Adhere to w3c standards #11646

Conversation

krmahadevan
Copy link
Contributor

@krmahadevan krmahadevan commented Feb 13, 2023

Fixes: #11466 #11458

New format

POST /se/files

Request:

{ "filename": "file" }

Response:

{
	"value": {
	"filename": "filename",
	"contents": "ContentsGoHere"
	}
}

GET /se/files

Request:
NONE

Response:

{
	"value": {
		"files":[
		"1",
		"2",
		"3"
		]
	}
}

Thanks for contributing to Selenium!
A PR well described will help maintainers to quickly review and merge it

Before submitting your PR, please check our contributing guidelines.
Avoid large PRs, help reviewers by making them as simple and short as possible.

Description

Motivation and Context

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist

  • I have read the contributing document.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have added tests to cover my changes.
  • All new and existing tests passed.

@krmahadevan
Copy link
Contributor Author

@diemol @titusfortner

This PR takes care of ONLY streamlining the url to be compliant with w3c urls and also adds the capability to list files for download.

The PR for #11443 will ensure that the downloads path references are all removed.

I thought it would be good if I go at this requirement on a piece by piece

@codecov-commenter
Copy link

codecov-commenter commented Feb 13, 2023

Codecov Report

Base: 54.65% // Head: 54.65% // No change to project coverage 👍

Coverage data is based on head (f04b698) compared to base (4f09bf0).
Patch has no changes to coverable lines.

❗ Current head f04b698 differs from pull request most recent head 63af6a8. Consider uploading reports for the commit 63af6a8 to get more accurate results

📣 This organization is not using Codecov’s GitHub App Integration. We recommend you install it so Codecov can continue to function properly for your repositories. Learn more

Additional details and impacted files
@@           Coverage Diff           @@
##            trunk   #11646   +/-   ##
=======================================
  Coverage   54.65%   54.65%           
=======================================
  Files          85       85           
  Lines        5643     5643           
  Branches      244      244           
=======================================
  Hits         3084     3084           
  Misses       2315     2315           
  Partials      244      244           

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

☔ View full report at Codecov.
📢 Do you have feedback about the report comment? Let us know in this issue.

@surajverma255
Copy link

Hi Community,
Have just started to explore the Open Source Community.
As a Noobie, I feel we should have a quick description of the changes someone is pushing which will make it easier to understand the context of change :)

@titusfortner
Copy link
Member

@krmahadevan I agree with going piece by piece, so I broke up the issue above into 5 components, this being two I think. Will review soon.

@surajverma255 welcome! Please read the issues linked in the PR to better understand the context.

@titusfortner
Copy link
Member

yeah, ok, @diemol will have to review the code as I'm lost in this part of Selenium, but the syntax looks correct to me.

Diego previously proposed to add file timestamp info with the GET response. To be honest, it would be a lot easier not to include it. Especially if we are already breaking things out by session, but we should agree on that bit.

Copy link
Member

@diemol diemol left a comment

Choose a reason for hiding this comment

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

Just very minor comments, as in the endpoint already shows it is about files.

Thank you, @krmahadevan!

@krmahadevan krmahadevan force-pushed the fix_downloads_url_to_adhere_to_w3c_spec branch from 92c9650 to e25bfae Compare February 17, 2023 03:24
@krmahadevan
Copy link
Contributor Author

Just very minor comments, as in the endpoint already shows it is about files.

Thank you, @krmahadevan!

Thank you @diemol. i have fixed the review comments as an additional commit and also rebased off of trunk. Can I go ahead and merge this or would you or @titusfortner do that? First PR after a committer :) So I dont know yet if I can hit the merge button (Even though I can see it.. :D )

@diemol
Copy link
Member

diemol commented Feb 17, 2023

@krmahadevan sure, go for it.

Fixes: SeleniumHQ#11466, SeleniumHQ#11458


New format

`POST /se/files`


Request:

`{ "filename": "file" }`


Response:
```
{
	"value": {
	"filename": "filename",
	"contents": "ContentsGoHere"
	}
}
```

`GET /se/files`

Request:
NONE

Response:
```
{
	"value": {
		"files":[
		"1",
		"2",
		"3"
		]
	}
}
```
@krmahadevan krmahadevan force-pushed the fix_downloads_url_to_adhere_to_w3c_spec branch from e25bfae to 63af6a8 Compare February 17, 2023 06:06
@krmahadevan krmahadevan merged commit b1300a6 into SeleniumHQ:trunk Feb 17, 2023
@krmahadevan krmahadevan deleted the fix_downloads_url_to_adhere_to_w3c_spec branch February 17, 2023 06:43
@krmahadevan krmahadevan linked an issue Feb 23, 2023 that may be closed by this pull request
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
5 participants