Skip to content

Commit

Permalink
🚑 Encode to base64
Browse files Browse the repository at this point in the history
  • Loading branch information
damianpumar committed Dec 4, 2024
1 parent 9cb2dde commit b0dcb76
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ export const useShareViewModel = () => {

const url = new URL(`${window.location.origin}/share`);
const params = new URLSearchParams("");
params.set("share_image", encodeURI(createImageLink()));
params.set("share_image_base64", btoa(createImageLink()));
params.set("dataset_name", dataset.name);
params.set("dataset_id", dataset.id);

Expand Down
4 changes: 3 additions & 1 deletion argilla-server/src/argilla_server/_app.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
import base64
import contextlib
import glob
import inspect
Expand Down Expand Up @@ -62,11 +63,12 @@ def configure_extra_pages(app: FastAPI):
@app.get("/share", include_in_schema=False)
async def share_page(
request: Request,
share_image: str = Query(),
share_image_base64: str = Query(),
dataset_name: str = Query(),
dataset_id: str = Query(),
):
url = request.url
share_image = base64.b64decode(share_image_base64)

Check warning on line 71 in argilla-server/src/argilla_server/_app.py

View check run for this annotation

Codecov / codecov/patch

argilla-server/src/argilla_server/_app.py#L70-L71

Added lines #L70 - L71 were not covered by tests

share_page = f"""

Check warning on line 73 in argilla-server/src/argilla_server/_app.py

View check run for this annotation

Codecov / codecov/patch

argilla-server/src/argilla_server/_app.py#L73

Added line #L73 was not covered by tests
<!DOCTYPE html>
Expand Down

0 comments on commit b0dcb76

Please sign in to comment.