Comments (2)
Hi @sebastianconcept, thanks for reporting this.
Just to be sure I'm understand the problem properly, is the main goal to set the response headers on an aborted response?
If yes, then I think this way it should work:
Teapot stopAll.
Teapot on
GET: '/' -> [:req |
req abort:
(TeaResponse unauthorized
headers: { 'test-header' -> 'test-value' } asDictionary;
yourself).
];
start.
$ curl -v http://localhost:1701/
* Trying ::1...
* TCP_NODELAY set
* Connection failed
* connect to ::1 port 1701 failed: Connection refused
* Trying 127.0.0.1...
* TCP_NODELAY set
* Connected to localhost (127.0.0.1) port 1701 (#0)
> GET / HTTP/1.1
> Host: localhost:1701
> User-Agent: curl/7.64.1
> Accept: */*
>
< HTTP/1.1 401 Unauthorized
< Server: Zinc HTTP Components 1.0 (Pharo/10.0)
< Date: Sun, 29 Jan 2023 20:35:34 GMT
< test-header: test-value
< Content-Type: text/html;charset=utf-8
< Content-Length: 2
<
Please let me know if I misunderstood something.
from teapot.
Oh missed that we can do that. Closing it. Thank you @zeroflag !
from teapot.
Related Issues (15)
- POST/PUT Request Bodies HOT 1
- Ajax-based form request parameters are not detected HOT 1
- Used teapots doesn't are GC collected HOT 1
- Teapot-Tools no longer loads on Pharo 10 HOT 2
- testTralingSlash is failing
- Replace gtInspectors
- Cupboard should be a spec presenter
- World Menu Error on Pharo 7 HOT 2
- Adjust Button labels for Spec2 based Cupboard
- Baseline dependency with ZincComponents
- TeaPadding does not understand #readStream HOT 6
- 404 response instead of 405 HOT 7
- Migration to Github HOT 15
- Teaspoon fails on pharo 8 because of move to Spec2 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 teapot.