PacketFire / paste-click

Paste text, images, video or any file
http://paste.click
3 stars 1 forks source link

Update text/html to -> text/plain #58

Closed ncatelli closed 5 years ago

ncatelli commented 5 years ago

Introduction

This PR includes a tiny hotfix to rewrite text/html -> text/plain. I've included an example manual test below showing that it works.

echo 'world' | curl -sv 'http://localhost:8001/' -H 'content-type: text/html' -H 'Host: paste.click' --data-binary @-
*   Trying ::1...
* TCP_NODELAY set
* Connected to localhost (::1) port 8001 (#0)
> POST / HTTP/1.1
> Host: paste.click
> User-Agent: curl/7.54.0
> Accept: */*
> content-type: text/html
> Content-Length: 6
>
* upload completely sent off: 6 out of 6 bytes
< HTTP/1.1 200 OK
< Date: Tue, 26 Feb 2019 14:30:54 GMT
< Content-Length: 45
< Content-Type: text/plain; charset=utf-8
<
http://localhost:8080/WReFt5RgHiErJg4lklY2_Q
* Connection #0 to host localhost left intact
curl -sD - 'http://localhost:8001/WReFt5RgHiErJg4lklY2_Q' -H 'Host: paste.click'
HTTP/1.1 200 OK
Content-Type: text/plain
Pc-Mime-Type: text/plain
Pc-Object: WReFt5RgHiErJg4lklY2_Q
Pc-Size:
Pc-Uploaded: 2019-02-26 14:30:54.5903185 +0000 UTC m=+714.005086701
Date: Tue, 26 Feb 2019 14:31:35 GMT
Content-Length: 6

world

It's worth noting that this is ONLY a hotfix and that we should address a more permanent solution to rewrite rules for sanitizing metadata down the line.

Dependencies

56

TODO

Review