Comments (9)
This looks like a Vercel bug:
https://til.simonwillison.net/-/asgi-scope?sql=a%2Bb returns 'query_string': b'sql=a+b'
https://til.simonwillison.net/-/asgi-scope?sql=a+b returns 'query_string': b'sql=a b'
from datasette-publish-vercel.
And https://til.simonwillison.net/-/asgi-scope?sql=a%252Bb with double-encoding a%252Bb
produces 'query_string': b'sql=a%2Bb'
.
from datasette-publish-vercel.
If it's a Vercel bug it will be in this code: https://github.com/vercel/vercel/blob/fcb14fa70e800ff2bf387120ebdaf65affea6661/packages/now-python/now_init.py#L261-L280
url = urlparse(unquote(payload['path']))
query = url.query.encode()
path = url.path
scope = {
'server': (headers.get('host', 'lambda'), headers.get('x-forwarded-port', 80)),
'client': (headers.get(
'x-forwarded-for', headers.get(
'x-real-ip', payload.get(
'true-client-ip', ''))), 0),
'scheme': headers.get('x-forwarded-proto', 'http'),
'root_path': '',
'query_string': query,
'headers': [[k.lower().encode(), v.encode()] for k, v in headers.items()],
'type': 'http',
'http_version': '1.1',
'method': payload['method'],
'path': path,
'raw_path': path.encode(),
}
from datasette-publish-vercel.
This commit is useful as it helps demonstrate how testing works for now-python: vercel/vercel@8253e76
from datasette-publish-vercel.
This fixture: https://github.com/vercel/vercel/blob/fcb14fa70e800ff2bf387120ebdaf65affea6661/packages/now-python/test/fixtures/12-asgi-function/index.py is exercised by this test: https://github.com/vercel/vercel/blob/8a68211cad8d2afae02ac1b85184e07d8911d47b/packages/now-python/test/fixtures/12-asgi-function/now.json#L10
from datasette-publish-vercel.
Also possibly relevant: vercel/vercel@8503af7#diff-9fd170c5d0171ce84976ebc317c15bcb is a commit titled "[now-python] Fix space encoding"
from datasette-publish-vercel.
Just saw this one again in the wild - upgrading to latest Vercel builder in #34 may fix this.
from datasette-publish-vercel.
Yep, fixed in #35
from datasette-publish-vercel.
Yup, that fixes it: https://datasette-vercel-python-fix.vercel.app/fixtures?sql=select+date(%27now%27%2C+%22%2B30+days%22)
from datasette-publish-vercel.
Related Issues (20)
- Signing secret not used HOT 1
- [Warning] The `name` property in vercel.json is deprecated
- template directory fails on non-default path HOT 1
- `--scope teamname` option HOT 2
- `datasette publish vercel` having issues with exporting JSON HOT 18
- Datasette 0.59 broke this plugin
- Site no longer deploys HOT 1
- Ability to specify a custom vercel.json HOT 2
- Use the new File System API HOT 1
- Query page .csv and .json links are not correctly URL-encoded on Vercel under unknown specific conditions HOT 8
- Ensure ds.invoke_startup() runs on startup HOT 1
- `--crossdb` option for publishing with `crossdb=True`
- Error! unknown or unexpected option: --no-clipboard HOT 4
- RuntimeError('There is no current event loop in thread %r.') HOT 10
- Use Vercel's Build Output API
- WARN! `--confirm` is deprecated, please use `--yes` instead HOT 4
- --setting allow_download 0 causes a 500 error HOT 3
- Bug cannot read properties of undefined HOT 7
- Error: No such command 'vercel'. HOT 1
- Unable to deploy using Vercel CLI 32.5.6 HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from datasette-publish-vercel.